<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
    String queryString = request.getQueryString() == null ? "" : request.getQueryString().replaceAll("(\\&?lang\\=[a-zA-Z]{2}\\_[a-zA-Z]{2})|(lang\\=[a-zA-Z]{2}\\_[a-zA-Z]{2}\\&?)", "");
    String lang = request.getParameter("lang");
    if (lang != null) {
        session.setAttribute("locale", lang);
    } else if (session.getAttribute("locale") == null) {
        session.setAttribute("locale", request.getLocale().toString());
    }
%>
<!DOCTYPE html>
<html lang="zh">
<c:if test="${'zh_CN'.equals(sessionScope.locale)}">
    <fmt:setLocale value="zh_CN"/>
</c:if>
<c:if test="${sessionScope.locale.indexOf('en') != -1}">
    <fmt:setLocale value="en_US"/>
</c:if>
<fmt:setBundle basename="charts" var="charts"/>
<fmt:bundle basename="charts">
    <head>
        <meta charset="utf-8"/>
            <%-- rem.js --%>
        <script src="<%=basePath%>/js/rem.js"></script>
        <title>医疗设备系统</title>
        <link rel="shortcut icon" href="<%=basePath%>/images/favicon.ico">
        <link href="<%=basePath%>/plugins/charts/css/global.css" rel="stylesheet"/>
        <link rel="stylesheet" href="<%=basePath%>/css/font-awesome.min.css">
        <link rel="stylesheet" href="<%=basePath%>/plugins/iziModal/css/iziModal.min.css">
        <link rel="stylesheet" href="<%=basePath%>/plugins/select2/select2.min.css">
        <link rel="stylesheet" href="<%=basePath%>/plugins/iCheck/all.css">
        <link href="<%=basePath%>/plugins/charts/css/select2-my.css" rel="stylesheet"/>
        <link href="<%=basePath%>/plugins/charts/css/style.css" rel="stylesheet"/>
        <link href="<%=basePath%>/plugins/charts/css/ccommon.css" rel="stylesheet"/>
        <link rel="stylesheet" href="<%=basePath%>/plugins/flavr/flavr.css">
    </head>
    <body>
    <div id="container">
            <%--顶部选项--%>
        <div class="head-container">
            <div class="head">
                <div class="fl global_area">
                    <i class="fa fa-arrow-left fl" onclick="javascript:history.go(-1);"></i>
                    <div class="fl" id="language">
                        <div class="language">
                            <c:choose>
                                <c:when test="${'zh_CN'.equals(sessionScope.locale)}">简体中文</c:when>
                                <c:when test="${sessionScope.locale.indexOf('en') != -1}">English</c:when>
                                <c:otherwise>简体中文</c:otherwise>
                            </c:choose>
                        </div>
                        <ul class="hide">
                            <li><a href="?<%=queryString%>&lang=zh_CN">简体中文</a></li>
                            <li><a href="?<%=queryString%>&lang=en_US">English</a></li>
                        </ul>
                    </div>
                    <ul class="global">
                        <li><a id="btn1"><fmt:message key="share.title.zl"/></a></li>
                        <li><a id="btn2" class="on"><span class="page" page-hospital="department-index"><fmt:message
                                key="share.title.fx"/></span>-<span class="page"
                                                                    page-hospital="type-index"><fmt:message
                                key="share.title.sblx"/></span>-<fmt:message key="share.title.whqk"/></a>
                        </li>
                        <li><a id="btn5"><img src="<%=basePath%>/plugins/charts/images/search.png"></a></li>
                        <li><a id="btn6" onclick="reset()"><img src="<%=basePath%>/plugins/charts/images/reset.png"></a>
                        </li>
                        <li><a id="btn7" onclick="logout()" title="<fmt:message key="share.title.tcdl"/>"><img src="<%=basePath%>/plugins/charts/images/logout.png"></a></li>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
        </div>
            <%--筛选条件--%>
        <jsp:include page="choose.jsp"></jsp:include>


        <div class="content" style="display:flex;flex-direction:column;justify-content:flex-start;">
            <div class="bottom_bar" style="flex:1;">
                <div class="list_area fl">
                    <div class="totle">
                            <%-- 强检 --%>
                        <div class="frame frame1" style="width:32%;">
                            <div class="border">
                                <div class="detail fl">
                                    <p class="title"><em class="spanTitle" id="title3"><fmt:message
                                            key="maintenance.overview.qjqk"/></em></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.qjjsl"/>：<em
                                            id="count3-1"></em> %</p>
                                    <p class="sum"><fmt:message key="share.overview.kssl"/>：<em id="yoy3-1"></em>
                                        <fmt:message key="share.unit.ge"/></p>
                                </div>
                                <div class="chart fr chart-text">
                                    <p class="sum"><fmt:message key="maintenance.overview.jhqjs"/>: <em
                                            id="count3-2"></em></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.sjqjs"/>：<em id="yoy3-2">&nbsp;</em>
                                    </p>
                                    <p class="line"></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.qjl"/>：<em id="count3-3"></em>
                                        %</p>
                                    <p class="sum"><fmt:message key="share.overview.tb"/>：<em id="count3-4"
                                                                                              class="yoy"></em></p>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </div>
                            <%-- 巡检 --%>
                        <div class="frame" style="width:32%;">
                            <div class="border">
                                <div class="detail fl">
                                    <p class="title"><em class="spanTitle" id="title2"><fmt:message
                                            key="maintenance.overview.xjqk"/></em></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.xjjsl"/>：<em
                                            id="count2-1"></em> %</p>
                                    <p class="sum"><fmt:message key="share.overview.kssl"/>：<em id="yoy2-1"></em>
                                        <fmt:message key="share.unit.ge"/></p>
                                </div>
                                <div class="chart fr chart-text">
                                    <p class="sum"><fmt:message key="maintenance.overview.jhxjs"/>: <em
                                            id="count2-2"></em></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.sjxjs"/>：<em id="yoy2-2">&nbsp;</em>
                                    </p>
                                    <p class="line"></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.xjl"/>：<em id="count2-3"></em>
                                        %</p>
                                    <p class="sum"><fmt:message key="share.overview.tb"/>：<em id="count2-4"
                                                                                              class="yoy"></em></p>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </div>
                            <%-- 保养 --%>
                        <div class="frame" style="width:32%;">
                            <div class="border">
                                <div class="detail fl">
                                    <p class="title"><em class="spanTitle active" id="title1"><fmt:message
                                            key="maintenance.overview.byqk"/></em></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.byjsl"/>：<em
                                            id="count1-1"></em> %</p>
                                    <p class="sum"><fmt:message key="share.overview.kssl"/>：<em id="yoy1-1"></em>
                                        <fmt:message key="share.unit.ge"/></p>
                                </div>
                                <div class="chart fr chart-text">
                                    <p class="sum"><fmt:message key="maintenance.overview.jhbys"/>: <em
                                            id="count1-2"></em></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.sjbys"/>：<em id="yoy1-2">&nbsp;</em>
                                    </p>
                                    <p class="line"></p>
                                    <p class="sum"><fmt:message key="maintenance.overview.byl"/>：<em id="count1-3"></em>
                                        %</p>
                                    <p class="sum"><fmt:message key="share.overview.tb"/>：<em id="count1-4"
                                                                                              class="yoy"></em></p>
                                </div>
                                <div class="clear"></div>
                            </div>
                        </div>
                    </div>
                        <%--当前情况图表--%>
                    <div class="border chart-border">
                        <div class="area" style="position:relative;">
                            <p class="title">
                                <span class="fl"><span class="fb spanTitle" id="moredetail"><fmt:message
                                        key="charts.title.sblxfb"/></span></span>
                                <span class="fl option_overyear"><fmt:message key="charts.button.yfxs"/></span>
                            </p>
                            <div id="swiper">
                                <div class="swiper-container">
                                    <div class="slide home-device">
                                        <div class="chartArea" id="chart" style="height:100%;"></div>
                                        <input id="currentTag" style="display:none;" value="tendency"/>
                                        <div class="pagination pagination1"></div>
                                    </div>
                                    <div class="slide second">
                                        <div class="chartArea" id="chartChange" style="height:100%;"></div>
                                    </div>
                                </div>
                                    <%--<span class="btn btn-left">&lt;</span>
                                    <span class="btn btn-right">&gt;</span>--%>
                            </div>
                        </div>
                    </div>
                </div>
                    <%--右侧排名--%>
                <div class="list_data fr">
                    <div class="border">
                        <div class="area">
                            <div class="data_detail">
                                <div id="top5_hospital" class="top5">
                                    <p class="title">
                                        <img src="<%=basePath%>/plugins/charts/images/yljg.png">
                                        <em id="morehospitals" class="spanTitle"><fmt:message
                                                key="share.table.head.yyks"/></em>
                                        <span>TOP5</span>
                                    </p>
                                    <p class="name"><span class="fl data_span_f"><fmt:message
                                            key="share.table.head.yyks"/></span><span
                                            class="fl listpercent"><fmt:message key="maintenance.top5.sj-jhbys"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="maintenance.table.byl(%)"/></span></p>
                                    <ul class="hospital" id="ul_hospital"></ul>
                                </div>
                                <div id="top5_type" class="top5">
                                    <p class="title">
                                        <img src="<%=basePath%>/plugins/charts/images/sblx.png">
                                        <em id="moretypes" class="spanTitle"><fmt:message
                                                key="share.table.head.sblx"/></em>
                                        <span>TOP5</span></p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.sblx"/></span>
                                        <span class="fl listpercent"><fmt:message
                                                key="maintenance.top5.sj-jhbys"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="maintenance.table.byl(%)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_type"></ul>
                                </div>

                                <div id="top5_year" class="top5" style="display:none;">
                                    <p class="title">
                                        <em id="moreyears" class="spanTitle" onclick="moreyear()"><fmt:message
                                                key="charts.button.yfxs"/></em>
                                    </p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.yf"/></span>
                                        <span class="fl listpercent data_span_s"><fmt:message
                                                key="maintenance.top5.sj-jhbys"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="maintenance.table.byl(%)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_year"></ul>
                                </div>
                                <div id="top5_device" class="top5">
                                    <p class="title">
                                        <em id="moredevices" class="spanTitle"><fmt:message
                                                key="share.table.head.jtsb"/></em>
                                        <span>TOP5</span></p>
                                    <p class="name">
                                        <span class="fl data_span_f"><fmt:message key="share.table.head.sbmc"/></span>
                                        <span class="fl listpercent data_span_s"><fmt:message
                                                key="maintenance.top5.sj-jhbys"/></span>
                                        <span class="fr listcontent"><fmt:message
                                                key="maintenance.table.byl(%)"/></span>
                                    </p>
                                    <ul class="hospital" id="ul_device"></ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="baseline"></div>
            <%--详情图表模态框--%>
        <div id="modal" style="display:none">
            <div class="row">
                <div class="col-md-12">
                    <div class="box-body no-padding">
                        <table id="tblSort" class="table table-bordered table-striped table-hover table-responsive">
                            <tbody id="table_data">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div id="typeModal" class="modal" style="display:none;padding-top: 58px;height: 100%;box-sizing: border-box;">
            <div class="row">
                <div class="col-md-12">
                    <div class="box-body no-padding">
                        <table id="typeTable" class="table table-bordered table-striped table-hover table-responsive">
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

        <%-- JS部分 --%>
    <script src="<%=basePath%>/plugins/jQuery/jquery-2.2.3.min.js"></script>
    <script src="<%=basePath%>/plugins/jQuery/jquery.cookie.js"></script>
    <script src="<%=basePath%>/plugins/fastclick/fastclick_1.0.6.min.js"></script>
    <script src="<%=basePath%>/plugins/flavr/flavr.min.js"></script>
    <script src="<%=basePath%>/plugins/charts/js/echarts.min.js"></script>
    <!-- 引入 macarons 主题 -->
    <script src="<%=basePath%>/echarts/customed.js"></script>
    <script src="<%=basePath%>/plugins/select2/select2.full.min.js"></script>
    <script src="<%=basePath%>/plugins/select2/i18n/zh-CN.js"></script>
    <script src="<%=basePath%>/plugins/iziModal/js/iziModal.min.js"></script>
    <script src="<%=basePath%>/plugins/iCheck/icheck.min.js"></script>
    <script src="<%=basePath%>/plugins/jQuery/JQMeter.min.js"></script>
    <script src="<%=basePath%>/plugins/charts/js/plugins.js"></script>
    <script src="<%=basePath%>/plugins/charts/js/tableHeadFixer.js"></script>
    <script>
        /*--------- 全局变量 ---------*/
        var CONST = 1000000;
        var basePath = '<%=basePath%>';
        var seriesIndex = 2;
        var title = 0;
        var listcontentWidth = $('.listcontent').eq(0).width();
        var maintenanceType = 1;
        /*--------- 全局变量 ---------*/

        /* 页面初始化 */
        $(function () {
            loading(function () {
                addChooseRadioEvent('hospital');
                resizeWindow();
                initChart();  // 初始化图表
                ChooseBox.siblingsClick();
                querySearch("hospital", '');
                querySearch("risk", '');
                querySearch("type", '');
                querySearch("brand", '');
                querySearch("year", '');
                getParams();
                appendTime();
                clickChange($('.detail .title em'));
                $("#btn5").click(function () {
                    ChooseBox.toggle();
                });
            });
        });

        // 初始化图表并添加图表点击事件
        function initChart() {
            chart = echarts.init(document.getElementById('chart'), 'customed');  // 初始化echarts实例
            chart.on("click", click);
        }

        var optionB1Temp, optionB1TempTemp;
        var queryStatus = {
            arr: ['hospital', 'type', 'assets'],
            getStatus: function () {
                for (var i = 0; i < this.arr.length; i++) {
                    if (!this[this.arr[i]]) return false;
                }
                return true;
            },
            resetStatus: function () {
                for (var i = 0; i < this.arr.length; i++) {
                    this[this.arr[i]] = false;
                }
            }
        };
        function click(param) {
            if (typeof param.seriesIndex === 'undefined') {
                return;
            }
            if (param.componentType === 'markLine') {
                return;
            }
            loading();
            if (param.type === 'click') {
                var index = xAxisType.indexOf(xAxisTypeOption[param.dataIndex]);
                seriesIndex = param.seriesIndex;

                if ($('.option_overyear').hasClass('active')) {
                    loading(true);
                    return;
                    $('.select_year').val(idsB[index]).trigger('change');
                    $('.option_overyear').removeClass('active');
                    getParams();
                } else {
                    var tab;
                    if (($('.select_type').val() ? $('.select_type').val() : []).join(',') == [idsType[index]].join(',')) {
                        $('.select_type').val('').trigger('change');
                        typeId = '';
                        tab = false;
                        index = 0;
                    } else {
                        $('.select_type').val([idsType[index]]).trigger('change');
                        typeId = [idsType[index]];
                        tab = true;
                    }

                    if (copySatus) {
                        optionB1Temp = $.extend(true, {}, optionB1);
                        optionB1TempTemp = $.extend(true, {}, optionB1);
                    } else {
                        optionB1Temp = $.extend(true, {}, optionB1TempTemp);
                    }
                    copySatus = false;
                    if (optionB1Temp.series[seriesIndex].type == 'bar') {
                        optionB1Temp.series[seriesIndex].itemStyle.normal.opacity = 1;
                    } else if (optionB1Temp.series[seriesIndex].type == 'line') {
                        optionB1Temp.series[seriesIndex].lineStyle.normal.width = 4;
                        optionB1Temp.series[seriesIndex].z = 10;
                    }
                    chart.setOption(optionB1Temp);

                    setUlType('desc', idsType[index], tab);
                    queryStatus.type = true;
                    queryChartsData();
                    queryDeviceTop5Data();
                }
            }
        }

        $('#title1').click(function () {
            loading(function () {
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                showYearTop5();
                $('#moredetail').html('<fmt:message key="charts.title.sblxfb"/>').off().on('click', moretypes);
                maintenanceType = 1;
                title = 0;
                typeId = JSON.parse($.cookie('chooseValue')).typeId;
                queryChartsData();
                queryTypeTop5Data();
                queryDeviceTop5Data();
            });
        });

        $('#title2').click(function () {
            loading(function () {
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                showYearTop5();
                $('#moredetail').html('<fmt:message key="charts.title.sblxfb"/>').off().on('click', moretypes);
                maintenanceType = 2;
                title = 1;
                typeId = JSON.parse($.cookie('chooseValue')).typeId;
                queryChartsData();
                queryTypeTop5Data();
                queryDeviceTop5Data();
            });
        });

        $('#title3').click(function () {
            loading(function () {
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                showYearTop5();
                $('#moredetail').html('<fmt:message key="charts.title.sblxfb"/>').off().on('click', moretypes);
                maintenanceType = 3;
                title = 2;
                typeId = JSON.parse($.cookie('chooseValue')).typeId;
                queryChartsData();
                queryTypeTop5Data();
                queryDeviceTop5Data();
            });
        });

        //查询筛选条件
        var typeIdArr;

        function querySearch(tag, tagId) {
            var url = "<%=basePath%>/hospital/search/" + (tag == 'hospital' ? 'department' : tag);
            $.ajax({
                type: "POST",
                data: {
                  hospitalId: hspId},
                url: url,
                async: false,
                dataType: "json",
                success: function (data) {
                    if (data.ret === 1) {
                        data.data = data.data || {list: []};
                        var searchData = data.data;
                        setSearch(tag, searchData);
                        $('.select_' + tag).select2({
                            placeholder: '<fmt:message key="share.sift.qxz"/>',
                            allowClear: true
                        });
                        ChooseBox.setSearchFromCookie(tag);
                        if (tag == 'type') {
                            searchDataGlobal = searchData;
                            $('.select_type').on('select2:select', function (param) {
                                typeIdArr = $('.select_type').val();
                                var id = param.params.data.id;
                                if (id < 2016102346) {
                                    for (var i = 0; i < searchDataGlobal[id].length; i++) {
                                        typeIdArr.push(searchDataGlobal[id][i].id)
                                    }
                                }
                                $('.select_type').val(typeIdArr).trigger('change');
                            });
                            $('.select_type').on('select2:unselect', function (param) {
                                typeIdArr = $('.select_type').val();
                                var id = param.params.data.id;
                                typeIdArr.removeByValue(id);
                                if (id < 2016102346) {
                                    for (var i = 0; i < searchDataGlobal[id].length; i++) {
                                        typeIdArr.removeByValue(searchDataGlobal[id][i].id)
                                    }
                                }
                                $('.select_type').val(typeIdArr).trigger('change');
                            });
                        }
                        if (tag == 'hospital' && window.location.search.split('=')[1]) {
                            hospitalId = GetQueryString('hospitalId') ? [GetQueryString('hospitalId')] : '';
                            $('.select_hospital').val(hospitalId).trigger('change');
                        }
                    } else {
                        if (data.msg == '该用户不存在') {
                            location.href = '<%=basePath%>';
                        } else {
                            flavrShowByTime(data.msg, null, "danger", false);
                        }
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        /* 设置搜索框搜索条件 */
        function setSearch(tag, data) {
            var first, second, id, str, str1;
            if (tag === "type") {
                str = '';
                first = data.first;
                for (var i = 0; i < first.length; i++) {
                    //一级设备
                    if ('${sessionScope.locale}'.indexOf('en') != -1) {
                        str += '<optgroup label="' + (first[i].enName || "") + '">' +
                            (function () {
                                str1 = '';
                                id = first[i].id;
                                if (data[id]) {
                                    //一级设备
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].enName || "") + '</option>';
                                    second = data[id];
                                    for (var j = 0; j < second.length; j++) {
                                        //二级设备
                                        str1 += '<option value="' + second[j].id + '">' + (second[j].enName || "") + '</option>';
                                    }
                                } else {
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].enName || "") + '</option>';
                                }
                                return str1;
                            })() +
                            '</optgroup>';
                    } else {
                        str += '<optgroup label="' + (first[i].name || "") + '">' +
                            (function () {
                                str1 = '';
                                id = first[i].id;
                                if (data[id]) {
                                    //一级设备
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].name || "") + '</option>';
                                    second = data[id];
                                    for (var j = 0; j < second.length; j++) {
                                        //二级设备
                                        str1 += '<option value="' + second[j].id + '">' + (second[j].name || "") + '</option>';
                                    }
                                } else {
                                    str1 = '<option value="' + first[i].id + '">' + (first[i].name || "") + '</option>';
                                }
                                return str1;
                            })() +
                            '</optgroup>';
                    }
                }
                $(".select_type").append(str);
            } else {
                data = data.list;
                if (tag == 'department') {
                    if ('${sessionScope.locale}'.indexOf('en') != -1) {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + 'hospital').append('<option value="' + data[i].id + '">' + (data[i].enName || "") + '</option>');
                        }
                    } else {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + 'hospital').append('<option value="' + data[i].id + '">' + (data[i].name || "") + '</option>');
                        }
                    }
                } else {
                    if ('${sessionScope.locale}'.indexOf('en') != -1) {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + tag).append('<option value="' + data[i].id + '">' + (data[i].enName || "") + '</option>');
                        }
                    } else {
                        for (var i = 0; i < data.length; i++) {
                            $(".select_" + tag).append('<option value="' + data[i].id + '">' + (data[i].name || "") + '</option>');
                        }
                    }
                }
            }

        }

        //全市详情
        function queryAllAssets() {
            $.ajax({
                type: "POST",
                url: "<%=basePath%>/charts/hospital/maintenance/overview",
                async: true,
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintenanceType: maintenanceType
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret == 1) {
                        data.data = data.data || {list: []};
                        data = data.data;
                        assets = data;
                        // 保养及时率 及 医院数量
                        $('#count1-1').html(parseFloat(data.upkeepOverview.upkeepTimelyPercentage || 0).toFixed(2));
                        $('#yoy1-1').html(data.upkeepOverview.departmentNum || 0);
                        // 计划保养数 及 实际保养数
                        $('#count1-2').html(data.upkeepOverview.upkeepDateCount || 0);
                        $('#yoy1-2').html(data.upkeepOverview.upkeepInfoCount || 0);
                        // 保养率 及 同比
                        $('#count1-3').html(parseFloat(data.upkeepOverview.jnUpkeepPercentage || 0).toFixed(2));
                        $('#count1-4').html(parseFloat(data.upkeepOverview.tbUpkeepPercentage || 0).toFixed(2) + '%');

                        // 巡检及时率 及 医院数量
                        $('#count2-1').html(parseFloat(data.inspectionOverview.inspectionTimelyPercentage || 0).toFixed(2));
                        $('#yoy2-1').html(data.inspectionOverview.departmentNum || 0);
                        // 计划巡检数 及 实际巡检数
                        $('#count2-2').html(data.inspectionOverview.inspectionDateCount || 0);
                        $('#yoy2-2').html(data.inspectionOverview.inspectionInfoCount || 0);
                        // 巡检率 及 同比
                        $('#count2-3').html(parseFloat(data.inspectionOverview.jnInspectionPercentage || 0).toFixed(2));
                        $('#count2-4').html(parseFloat(data.inspectionOverview.tbInspectionPercentage || 0).toFixed(2) + '%');

                        // 强检及时率 及 医院数量
                        $('#count3-1').html(parseFloat(data.compulsoryOverview.CompulsoryTimelyPercentage || 0).toFixed(2));
                        $('#yoy3-1').html(data.compulsoryOverview.departmentNum || 0);
                        // 计划强检数 及 实际强检数
                        $('#count3-2').html(data.compulsoryOverview.CompulsoryDateCount || 0);
                        $('#yoy3-2').html(data.compulsoryOverview.CompulsoryVerificationCount || 0);
                        // 强检率 及 同比
                        $('#count3-3').html(parseFloat(data.compulsoryOverview.jnCompulsoryPercentage || 0).toFixed(2));
                        $('#count3-4').html(parseFloat(data.compulsoryOverview.tbCompulsoryPercentage || 0).toFixed(2) + '%');

                        addArrowYoy('.totle');
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            });
        }

        //医院top5
        function setUlHospital(sortord, index, tab) {
            var len = xAxis.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_hospital").html('');
            if (title == 0) {
                $('.listpercent').html('<fmt:message key="maintenance.top5.sj-jhbys"/>');
                switch (seriesIndex) {
                    case 0:
                        $('.listcontent').html('<fmt:message key="maintenance.table.jhbys"/>');
                        sort('desc', jnUpkeepDateCount, jnUpkeepPercentage, ids, xAxis, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 1:
                        $('.listcontent').html('<fmt:message key="maintenance.overview.sjbys"/>');
                        sort('desc', jnUpkeepInfoCount, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 2:
                        $('.listcontent').html('<fmt:message key="maintenance.table.byl(%)"/>');
                        sort('desc', jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 3:
                        $('.listcontent').html('<fmt:message key="maintenance.table.byjsl(%)"/>');
                        sort('desc', upkeepTimelyPercentage, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                }
            } else if (title == 1) {
                $('.listpercent').html('<fmt:message key="maintenance.top5.sj-jhxjs"/>');
                switch (seriesIndex) {
                    case 0:
                        $('.listcontent').html('<fmt:message key="maintenance.table.jhxjs"/>');
                        sort('desc', jnInspectionDateCount, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 1:
                        $('.listcontent').html('<fmt:message key="maintenance.table.sjxjs"/>');
                        sort('desc', jnInspectionInfoCount, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 2:
                        $('.listcontent').html('<fmt:message key="maintenance.table.xjl(%)"/>');
                        sort('desc', jnInspectionPercentage, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 3:
                        $('.listcontent').html('<fmt:message key="maintenance.table.xjjsl(%)"/>');
                        sort('desc', inspectionTimelyPercentage, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                }
            } else if (title == 2) {
                $('.listpercent').html('<fmt:message key="maintenance.top5.sj-jhqjs"/>');
                switch (seriesIndex) {
                    case 0:
                        $('.listcontent').html('<fmt:message key="maintenance.table.jhqjs"/>');
                        sort('desc', jnCompulsoryDateCount, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 1:
                        $('.listcontent').html('<fmt:message key="maintenance.table.sjqjs"/>');
                        sort('desc', jnCompulsoryVerificationCount, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryPercentage, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 2:
                        $('.listcontent').html('<fmt:message key="maintenance.table.qjl(%)"/>');
                        sort('desc', jnCompulsoryPercentage, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, tbCompulsoryPercentage, compulsoryTimelyPercentage, fullName);
                        break;
                    case 3:
                        $('.listcontent').html('<fmt:message key="maintenance.table.qjjsl(%)"/>');
                        sort('desc', compulsoryTimelyPercentage, jnUpkeepPercentage, ids, xAxis, jnUpkeepDateCount, jnUpkeepInfoCount, tbUpkeepPercentage, upkeepTimelyPercentage, jnInspectionDateCount, jnInspectionInfoCount, jnInspectionPercentage, inspectionTimelyPercentage, tbInspectionPercentage, jnCompulsoryDateCount, jnCompulsoryVerificationCount, jnCompulsoryPercentage, tbCompulsoryPercentage, fullName);
                        break;
                }
            }
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = jnUpkeepInfoCount[i] + '/' + jnUpkeepDateCount[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnUpkeepDateCount[i];
                            break;
                        case 1:
                            count = jnUpkeepInfoCount[i];
                            break;
                        case 2:
                            count = parseFloat(jnUpkeepPercentage[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(upkeepTimelyPercentage[i]).toFixed(2);
                            break;
                    }
                } else if (title == 1) {
                    percent = jnInspectionInfoCount[i] + '/' + jnInspectionDateCount[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnInspectionDateCount[i];
                            break;
                        case 1:
                            count = jnInspectionInfoCount[i];
                            break;
                        case 2:
                            count = parseFloat(jnInspectionPercentage[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(inspectionTimelyPercentage[i]).toFixed(2);
                            break;
                    }
                } else if (title == 2) {
                    percent = jnCompulsoryVerificationCount[i] + '/' + jnCompulsoryDateCount[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnCompulsoryDateCount[i];
                            break;
                        case 1:
                            count = jnCompulsoryVerificationCount[i];
                            break;
                        case 2:
                            count = parseFloat(jnCompulsoryPercentage[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(compulsoryTimelyPercentage[i]).toFixed(2);
                            break;
                    }
                }
                $("#ul_hospital").append(
                    '<li><a title="' + (i + 1) + ' ' + fullName[i] + '"' + ((tab && i == index) ? 'class="active"' : '') + ' onclick="query(\'hospital\',\''+ids[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxis[i] + '</span><em class="fl data_span_f">'
                    + percent + '</em><em class="fr jqmeter" jqmeter="' + count + '">' + count + '</em></a></li>');
            }
            if(seriesIndex < 2) return;
            $('#ul_hospital .jqmeter').each(function () {
                $(this).jQMeter({
                    goal: '$1,00',
                    raised: '$' + Math.round($(this).attr('jqmeter')),
                    width: listcontentWidth - 20 + 'px',
                    height: '0.24rem'
                });
            });
        }

        //设置与图表对应的表的内容
        function setUlType(sortord, index, tab) {
            if (title == 0) {
                switch (seriesIndex) {
                    case 0:
                        sort('desc', jnUpkeepDateCountType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 1:
                        sort('desc', jnUpkeepInfoCountType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 2:
                        sort('desc', jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 3:
                        sort('desc', upkeepTimelyPercentageType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                }
            } else if (title == 1) {
                switch (seriesIndex) {
                    case 0:
                        sort('desc', jnInspectionDateCountType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 1:
                        sort('desc', jnInspectionInfoCountType, jnUpkeepInfoCountType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 2:
                        sort('desc', jnInspectionPercentageType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 3:
                        sort('desc', inspectionTimelyPercentageType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                }
            } else if (title == 2) {
                switch (seriesIndex) {
                    case 0:
                        sort('desc', jnCompulsoryDateCountType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 1:
                        sort('desc', jnCompulsoryVerificationCountType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 2:
                        sort('desc', jnCompulsoryPercentageType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, tbCompulsoryPercentageType, compulsoryTimelyPercentageType, fullNameType);
                        break;
                    case 3:
                        sort('desc', compulsoryTimelyPercentageType, jnUpkeepPercentageType, idsType, xAxisType, jnUpkeepDateCountType, jnUpkeepInfoCountType, tbUpkeepPercentageType, upkeepTimelyPercentageType, jnInspectionDateCountType, jnInspectionInfoCountType, jnInspectionPercentageType, inspectionTimelyPercentageType, tbInspectionPercentageType, jnCompulsoryDateCountType, jnCompulsoryVerificationCountType, jnCompulsoryPercentageType, tbCompulsoryPercentageType, fullNameType);
                        break;
                }
            }
            index = idsType.indexOf(index);
            var len = xAxisType.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_type").html('');
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = jnUpkeepInfoCountType[i] + '/' + jnUpkeepDateCountType[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnUpkeepDateCountType[i];
                            break;
                        case 1:
                            count = jnUpkeepInfoCountType[i];
                            break;
                        case 2:
                            count = parseFloat(jnUpkeepPercentageType[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(upkeepTimelyPercentageType[i]).toFixed(2);
                            break;
                    }
                } else if (title == 1) {
                    percent = jnInspectionInfoCountType[i] + '/' + jnInspectionDateCountType[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnInspectionDateCountType[i];
                            break;
                        case 1:
                            count = jnInspectionInfoCountType[i];
                            break;
                        case 2:
                            count = parseFloat(jnInspectionPercentageType[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(inspectionTimelyPercentageType[i]).toFixed(2);
                            break;
                    }
                } else if (title == 2) {
                    percent = jnCompulsoryVerificationCountType[i] + '/' + jnCompulsoryDateCountType[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnCompulsoryDateCountType[i];
                            break;
                        case 1:
                            count = jnCompulsoryVerificationCountType[i];
                            break;
                        case 2:
                            count = parseFloat(jnCompulsoryPercentageType[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(compulsoryTimelyPercentageType[i]).toFixed(2);
                            break;
                    }
                }
                $("#ul_type").append(
                    '<li><a title="' + (i + 1) + ' ' + fullNameType[i] + '"' + ((tab && i == index) ? 'class="active"' : '') + ' onclick="query(\'type\',\''+idsType[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisType[i] + '</span><em class="fl data_span_f">'
                    + percent + '</em><em class="fr jqmeter" jqmeter="' + count + '">' + count + '</em></a></li>');
            }
            if(seriesIndex < 2) return;
            $('#ul_type .jqmeter').each(function () {
                $(this).jQMeter({
                    goal: '$1,00',
                    raised: '$' + Math.round($(this).attr('jqmeter')),
                    width: listcontentWidth - 20 + 'px',
                    height: '0.24rem'
                });
            });
        }

        function setUlDevice(sortord, index) {
            var len = xAxisDevice.length;
            var x = 0,
                y = 0;
            if (index < 3) {
                x = 0;
            } else if (len - index < 3) {
                x = (len - 5) > 0 ? (len - 5) : 0;
            } else {
                x = index - 2;
            }
            y = len > 5 ? x + 5 : len;
            var percent, count;
            $("#ul_device").html('');
            if (title == 0) {
                switch (seriesIndex) {
                    case 0:
                        sort('desc', jnUpkeepDateCountDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 1:
                        sort('desc', jnUpkeepInfoCountDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 2:
                        sort('desc', jnUpkeepPercentageDevice, xAxisDevice, departmentNameDevice, idsDevice, xAxisDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 3:
                        sort('desc', upkeepTimelyPercentageDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                }
            } else if (title == 1) {
                switch (seriesIndex) {
                    case 0:
                        sort('desc', jnInspectionDateCountDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 1:
                        sort('desc', jnInspectionInfoCountDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 2:
                        sort('desc', jnInspectionPercentageDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 3:
                        sort('desc', inspectionTimelyPercentageDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                }
            } else if (title == 2) {
                switch (seriesIndex) {
                    case 0:
                        sort('desc', jnCompulsoryDateCountDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 1:
                        sort('desc', jnCompulsoryVerificationCountDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 2:
                        sort('desc', jnCompulsoryPercentageDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, tbCompulsoryPercentageDevice, compulsoryTimelyPercentageDevice, fullNameDevice);
                        break;
                    case 3:
                        sort('desc', compulsoryTimelyPercentageDevice, jnUpkeepPercentageDevice, idsDevice, xAxisDevice, departmentNameDevice, snDevice, assetsNoDevice, upkeepCycleDevice, jnUpkeepDateCountDevice, jnUpkeepInfoCountDevice, tbUpkeepPercentageDevice, upkeepTimelyPercentageDevice, inspectionCycleDevice, jnInspectionDateCountDevice, jnInspectionInfoCountDevice, jnInspectionPercentageDevice, tbInspectionPercentageDevice, inspectionTimelyPercentageDevice, verificationCycleDevice, jnCompulsoryDateCountDevice, jnCompulsoryVerificationCountDevice, jnCompulsoryPercentageDevice, tbCompulsoryPercentageDevice, fullNameDevice);
                        break;
                }
            }
            for (var i = x; i < y; i++) {
                if (title == 0) {
                    percent = jnUpkeepInfoCountDevice[i] + '/' + jnUpkeepDateCountDevice[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnUpkeepDateCountDevice[i];
                            break;
                        case 1:
                            count = jnUpkeepInfoCountDevice[i];
                            break;
                        case 2:
                            count = parseFloat(jnUpkeepPercentageDevice[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(upkeepTimelyPercentageDevice[i]).toFixed(2);
                            break;
                    }
                } else if (title == 1) {
                    percent = jnInspectionInfoCountDevice[i] + '/' + jnInspectionDateCountDevice[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnInspectionDateCountDevice[i];
                            break;
                        case 1:
                            count = jnInspectionInfoCountDevice[i];
                            break;
                        case 2:
                            count = parseFloat(jnInspectionPercentageDevice[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(inspectionTimelyPercentageDevice[i]).toFixed(2);
                            break;
                    }
                } else if (title == 2) {
                    percent = jnCompulsoryVerificationCountDevice[i] + '/' + jnCompulsoryDateCountDevice[i];
                    switch (seriesIndex) {
                        case 0:
                            count = jnCompulsoryDateCountDevice[i];
                            break;
                        case 1:
                            count = jnCompulsoryVerificationCountDevice[i];
                            break;
                        case 2:
                            count = parseFloat(jnCompulsoryPercentageDevice[i]).toFixed(2);
                            break;
                        case 3:
                            count = parseFloat(compulsoryTimelyPercentageDevice[i]).toFixed(2);
                            break;
                    }
                }
                $("#ul_device").append(
                    '<li><a title="' + (i + 1) + ' ' + fullNameDevice[i] + '" onclick="query(\'device\',\''+idsDevice[i]+'\')"><span class="fl data_span_f spanTitle">' + xAxisDevice[i] + '</span><em class="fl data_span_f">'
                    + percent + '</em><em class="fr jqmeter" jqmeter="' + count + '">' + count + '</em></a></li>');
            }
            if(seriesIndex < 2) return;
            $('#ul_device .jqmeter').each(function () {
                $(this).jQMeter({
                    goal: '$1,00',
                    raised: '$' + parseInt($(this).attr('jqmeter')),
                    width: listcontentWidth - 20 + 'px',
                    height: '0.24rem'
                });
            });
        }


        //获取筛选条件参数
        function getParams() {
            loading(function () {
                $('.option_overyear').html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                showYearTop5();
                $('#moredetail').html('<fmt:message key="charts.title.sblxfb"/>').off().on('click', moretypes);

                hospitalId = $('.select_hospital').val() ? $('.select_hospital').val() : '';
                riskId = $('.select_risk').val() ? $('.select_risk').val() : '';
                typeId = $('.select_type').val() ? $('.select_type').val() : '';
                brandId = $('.select_brand').val() ? $('.select_brand').val() : '';
                year = $('.select_year').val() ? $('.select_year').val() : '';
                monthId = $('.select_month').val() ? $('.select_month').val() : '';
                enableYearStart = $('#enableYearStart').val() ? $('#enableYearStart').val() : '';
                enableYearEnd = $('#enableYearEnd').val() ? $('#enableYearEnd').val() : '';
                priceStart = $('#priceStart').val() ? $('#priceStart').val() * CONST : '';
                priceEnd = $('#priceEnd').val() ? $('#priceEnd').val() * CONST : '';
                ageLimitStart = $('#ageLimitStart').val() ? $('#ageLimitStart').val() : '';
                ageLimitEnd = $('#ageLimitEnd').val() ? $('#ageLimitEnd').val() : '';

                $.cookie('chooseValue', JSON.stringify({
                    hospitalId: hospitalId,
                    riskId: riskId,
                    typeId: typeId,
                    brandId: brandId,
                    year: year,
                    monthId: monthId,
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd
                }), {path: '/'});

                queryAllAssets();
                queryChartsData();
                queryTypeTop5Data();
                queryDeviceTop5Data();
            });
        }

        // 获取图表数据(医院)
        function queryChartsData(tableId) {
            ids = [];
            xAxis = [];
            jnUpkeepDateCount = [];             // 计划保养数
            jnUpkeepInfoCount = [];             // 实际保养数
            jnUpkeepPercentage = [];            // 保养率
            tbUpkeepPercentage = [];            // 同比
            upkeepTimelyPercentage = [];        // 保养及时率
            jnInspectionDateCount = [];         //  计划巡检数
            jnInspectionInfoCount = [];         // 实际巡检数
            jnInspectionPercentage = [];        // 巡检率
            inspectionTimelyPercentage = [];    // 巡检及时率
            tbInspectionPercentage = [];        // 巡检率同比
            jnCompulsoryDateCount = [];         // 计划强检数
            jnCompulsoryVerificationCount = []; // 实际强检数
            jnCompulsoryPercentage = [];        // 强检率
            tbCompulsoryPercentage = [];        // 同比
            compulsoryTimelyPercentage = [];    // 强检及时率
            fullName = [];

            hospitalJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/maintenance/department',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintenanceType: maintenanceType
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        hospitalJson = (data.data.list || []).sortByKey('jnUpkeepPercentage').calTotal();
                        for (var i = 0; i < data.data.list.length; i++) {
                            if ('${sessionScope.locale}'.indexOf('en') != -1) {
                                xAxis.push(data.data.list[i].enName || '');
                                fullName.push(data.data.list[i].fullEnName || '');
                                hospitalJson[i].name = hospitalJson[i].enName;
                            } else {
                                xAxis.push(data.data.list[i].name || '');
                                fullName.push(data.data.list[i].fullName || '');
                            }
                            ids.push(data.data.list[i].id || '');
                            jnUpkeepDateCount.push(data.data.list[i].jnUpkeepDateCount || 0);
                            jnUpkeepInfoCount.push(data.data.list[i].jnUpkeepInfoCount || 0);
                            jnUpkeepPercentage.push(parseFloat(data.data.list[i].jnUpkeepPercentage || 0).toFixed(2));
                            tbUpkeepPercentage.push(parseFloat(data.data.list[i].tbUpkeepPercentage || 0).toFixed(2));
                            upkeepTimelyPercentage.push(parseFloat(data.data.list[i].upkeepTimelyPercentage || 0).toFixed(2));
                            jnInspectionDateCount.push(data.data.list[i].jnInspectionDateCount || 0);
                            jnInspectionInfoCount.push(data.data.list[i].jnInspectionInfoCount || 0);
                            jnInspectionPercentage.push(parseFloat(data.data.list[i].jnInspectionPercentage || 0).toFixed(2));
                            inspectionTimelyPercentage.push(parseFloat(data.data.list[i].inspectionTimelyPercentage || 0).toFixed(2));
                            tbInspectionPercentage.push(parseFloat(data.data.list[i].tbInspectionPercentage || 0).toFixed(2));
                            jnCompulsoryDateCount.push(data.data.list[i].jnCompulsoryDateCount || 0);
                            jnCompulsoryVerificationCount.push(data.data.list[i].jnCompulsoryVerificationCount || 0);
                            jnCompulsoryPercentage.push(parseFloat(data.data.list[i].jnCompulsoryPercentage || 0).toFixed(2));
                            tbCompulsoryPercentage.push(parseFloat(data.data.list[i].tbCompulsoryPercentage || 0).toFixed(2));
                            compulsoryTimelyPercentage.push(parseFloat(data.data.list[i].compulsoryTimelyPercentage || 0).toFixed(2));
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setUlHospital('desc', 0);
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') == 'hospital')) morehospitals();

                    queryStatus.hospital = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function () {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        /*
        * tag  　0-保养率  1-巡检率  2-强检率
        * 设置图表数据
        * */
        function setChatsData(tag) {
            title = tag;
            optionB1.xAxis.data = xAxisType;
            if (tag == 0) {
                xAxisTypeOption = $.extend(true, {}, xAxisType);
                jnUpkeepPercentageTypeOption = $.extend(true, {}, jnUpkeepPercentageType);
                jnUpkeepDateCountTypeOption = $.extend(true, {}, jnUpkeepDateCountType);
                jnUpkeepInfoCountTypeOption = $.extend(true, {}, jnUpkeepInfoCountType);
                tbUpkeepPercentageTypeOption = $.extend(true, {}, tbUpkeepPercentageType);
                upkeepTimelyPercentageTypeOption = $.extend(true, {}, upkeepTimelyPercentageType);
                optionB1.legend.data = ['<fmt:message key="maintenance.overview.jhbys"/>', '<fmt:message key="maintenance.overview.sjbys"/>', '<fmt:message key="maintenance.overview.byl"/>', '<fmt:message key="maintenance.overview.byjsl"/>'];
                optionB1.series[0].name = '<fmt:message key="maintenance.overview.jhbys"/>';
                optionB1.series[1].name = '<fmt:message key="maintenance.overview.sjbys"/>';
                optionB1.series[2].name = '<fmt:message key="maintenance.overview.byl"/>';
                optionB1.series[3].name = '<fmt:message key="maintenance.overview.byjsl"/>';
                optionB1.series[0].data = jnUpkeepDateCountType;
                optionB1.series[1].data = jnUpkeepInfoCountType;
                optionB1.series[2].data = jnUpkeepPercentageType;
                optionB1.series[3].data = upkeepTimelyPercentageType;
            } else if (tag == 1) {
                xAxisTypeOption = $.extend(true, {}, xAxisType);
                jnInspectionPercentageTypeOption = $.extend(true, {}, jnInspectionPercentageType);
                jnInspectionDateCountTypeOption = $.extend(true, {}, jnInspectionDateCountType);
                jnInspectionInfoCountTypeOption = $.extend(true, {}, jnInspectionInfoCountType);
                inspectionTimelyPercentageTypeOption = $.extend(true, {}, inspectionTimelyPercentageType);
                tbInspectionPercentageTypeOption = $.extend(true, {}, tbInspectionPercentageType);
                optionB1.legend.data = ['<fmt:message key="maintenance.overview.jhxjs"/>', '<fmt:message key="maintenance.overview.sjxjs"/>', '<fmt:message key="maintenance.overview.xjl"/>', '<fmt:message key="maintenance.overview.xjjsl"/>'];
                optionB1.series[0].name = '<fmt:message key="maintenance.overview.jhxjs"/>';
                optionB1.series[1].name = '<fmt:message key="maintenance.overview.sjxjs"/>';
                optionB1.series[2].name = '<fmt:message key="maintenance.overview.xjl"/>';
                optionB1.series[3].name = '<fmt:message key="maintenance.overview.xjjsl"/>';
                optionB1.series[0].data = jnInspectionDateCountType;
                optionB1.series[1].data = jnInspectionInfoCountType;
                optionB1.series[2].data = jnInspectionPercentageType;
                optionB1.series[3].data = inspectionTimelyPercentageType;
            } else if (tag == 2) {
                xAxisTypeOption = $.extend(true, {}, xAxisType);
                jnCompulsoryPercentageTypeOption = $.extend(true, {}, jnCompulsoryPercentageType);
                jnCompulsoryDateCountTypeOption = $.extend(true, {}, jnCompulsoryDateCountType);
                jnCompulsoryVerificationCountTypeOption = $.extend(true, {}, jnCompulsoryVerificationCountType);
                tbCompulsoryPercentageTypeOption = $.extend(true, {}, tbCompulsoryPercentageType);
                compulsoryTimelyPercentageTypeOption = $.extend(true, {}, compulsoryTimelyPercentageType);
                optionB1.legend.data = ['<fmt:message key="maintenance.overview.jhqjs"/>', '<fmt:message key="maintenance.overview.sjqjs"/>', '<fmt:message key="maintenance.overview.qjl"/>', '<fmt:message key="maintenance.overview.qjjsl"/>'];
                optionB1.series[0].name = '<fmt:message key="maintenance.overview.jhqjs"/>';
                optionB1.series[1].name = '<fmt:message key="maintenance.overview.sjqjs"/>';
                optionB1.series[2].name = '<fmt:message key="maintenance.overview.qjl"/>';
                optionB1.series[3].name = '<fmt:message key="maintenance.overview.qjjsl"/>';
                optionB1.series[0].data = jnCompulsoryDateCountType;
                optionB1.series[1].data = jnCompulsoryVerificationCountType;
                optionB1.series[2].data = jnCompulsoryPercentageType;
                optionB1.series[3].data = compulsoryTimelyPercentageType;
            }
            //图表滚动条
            if (xAxisType.length > 12) {
                optionB1.dataZoom[0].end = 1200 / xAxisType.length;
            } else {
                optionB1.dataZoom[0].end = 100;
            }
            $('.option_overyear').removeClass('active');
            chart.clear();
            chart.setOption(optionB1);
        }

        // 获取图表数据(设备类型)
        function queryTypeTop5Data(tableId) {
            idsType = [];
            xAxisType = [];
            jnUpkeepDateCountType = [];             // 计划保养数
            jnUpkeepInfoCountType = [];             // 实际保养数
            jnUpkeepPercentageType = [];            // 保养率
            tbUpkeepPercentageType = [];            // 同比
            upkeepTimelyPercentageType = [];        // 保养及时率
            jnInspectionDateCountType = [];         //  计划巡检数
            jnInspectionInfoCountType = [];         // 实际巡检数
            jnInspectionPercentageType = [];        // 巡检率
            inspectionTimelyPercentageType = [];    // 巡检及时率
            tbInspectionPercentageType = [];        // 巡检率同比
            jnCompulsoryDateCountType = [];         // 计划强检数
            jnCompulsoryVerificationCountType = []; // 实际强检数
            jnCompulsoryPercentageType = [];        // 强检率
            tbCompulsoryPercentageType = [];        // 同比
            compulsoryTimelyPercentageType = [];    // 强检及时率
            fullNameType = [];
            seriesIndex = 2;

            typeJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/maintenance/type',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintenanceType: maintenanceType
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        typeJson = (data.data.list || []).sortByKey('jnUpkeepPercentage').calTotal();
                        for (var i = 0; i < typeJson.length; i++) {
                            for (var j = 0; j < typeJson[i].list.length; j++) {
                                if ('${sessionScope.locale}'.indexOf('en') != -1) {
                                    xAxisType.push(typeJson[i].list[j].enName || '');
                                    fullNameType.push(typeJson[i].list[j].fullEnName || '');
                                } else {
                                    xAxisType.push(typeJson[i].list[j].name || '');
                                    fullNameType.push(typeJson[i].list[j].fullName || '');
                                }
                                idsType.push(typeJson[i].list[j].id || '');
                                jnUpkeepDateCountType.push(typeJson[i].list[j].jnUpkeepDateCount || 0);
                                jnUpkeepInfoCountType.push(typeJson[i].list[j].jnUpkeepInfoCount || 0);
                                jnUpkeepPercentageType.push(parseFloat(typeJson[i].list[j].jnUpkeepPercentage || 0).toFixed(2));
                                tbUpkeepPercentageType.push(parseFloat(typeJson[i].list[j].tbUpkeepPercentage || 0).toFixed(2));
                                upkeepTimelyPercentageType.push(parseFloat(typeJson[i].list[j].upkeepTimelyPercentage || 0).toFixed(2));
                                jnInspectionDateCountType.push(typeJson[i].list[j].jnInspectionDateCount || 0);
                                jnInspectionInfoCountType.push(typeJson[i].list[j].jnInspectionInfoCount || 0);
                                jnInspectionPercentageType.push(parseFloat(typeJson[i].list[j].jnInspectionPercentage || 0).toFixed(2));
                                inspectionTimelyPercentageType.push(parseFloat(typeJson[i].list[j].inspectionTimelyPercentage || 0).toFixed(2));
                                tbInspectionPercentageType.push(parseFloat(typeJson[i].list[j].tbInspectionPercentage || 0).toFixed(2));
                                jnCompulsoryDateCountType.push(typeJson[i].list[j].jnCompulsoryDateCount || 0);
                                jnCompulsoryVerificationCountType.push(typeJson[i].list[j].jnCompulsoryVerificationCount || 0);
                                jnCompulsoryPercentageType.push(parseFloat(typeJson[i].list[j].jnCompulsoryPercentage || 0).toFixed(2));
                                tbCompulsoryPercentageType.push(parseFloat(typeJson[i].list[j].tbCompulsoryPercentage || 0).toFixed(2));
                                compulsoryTimelyPercentageType.push(parseFloat(typeJson[i].list[j].compulsoryTimelyPercentage || 0).toFixed(2));
                            }
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setUlType('desc', 0);
                    setChatsData(maintenanceType - 1);
                    copySatus = true;
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') == 'type')) moretypes();

                    queryStatus.type = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function (data) {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        function queryDeviceTop5Data(tableId) {
            idsDevice = [];
            xAxisDevice = [];
            departmentNameDevice = [];
            manufacturerDevice = [];
            snDevice = [];
            assetsNoDevice = [];
            upkeepCycleDevice = [];
            jnUpkeepDateCountDevice = [];
            jnUpkeepInfoCountDevice = [];
            jnUpkeepPercentageDevice = [];
            tbUpkeepPercentageDevice = [];
            upkeepTimelyPercentageDevice = [];
            inspectionCycleDevice = [];
            jnInspectionDateCountDevice = [];
            jnInspectionInfoCountDevice = [];
            jnInspectionPercentageDevice = [];
            tbInspectionPercentageDevice = [];
            inspectionTimelyPercentageDevice = [];
            verificationCycleDevice = [];
            jnCompulsoryDateCountDevice = [];
            jnCompulsoryVerificationCountDevice = [];
            jnCompulsoryPercentageDevice = [];
            tbCompulsoryPercentageDevice = [];
            compulsoryTimelyPercentageDevice = [];
            fullNameDevice = [];

            deviceJson = [];
            $.ajax({
                type: "POST",
                url: '<%=basePath%>/charts/hospital/maintenance/assets',
                data: {
                  hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: monthId ? JSON.stringify(monthId) : '',
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintenanceType: maintenanceType
                },
                dataType: "json",
                success: function (data) {
                    if (data.ret) {
                        data.data = data.data || {list: []};
                        deviceJson = (data.data.list || []).sortByKey('jnUpkeepPercentage').calTotal();
                        for (var i = 0; i < data.data.list.length; i++) {
                            idsDevice.push(data.data.list[i].id || '');
                            xAxisDevice.push(data.data.list[i].name || '');
                            departmentNameDevice.push((data.data.list[i].departmentName || ''));
                            manufacturerDevice.push(data.data.list[i].manufacturer || '');
                            snDevice.push((data.data.list[i].sn || ''));
                            assetsNoDevice.push(data.data.list[i].assetsNo || '');
                            upkeepCycleDevice.push((data.data.list[i].upkeepCycle || ''));
                            jnUpkeepDateCountDevice.push((data.data.list[i].jnUpkeepDateCount || 0));
                            jnUpkeepInfoCountDevice.push((data.data.list[i].jnUpkeepInfoCount || 0));
                            jnUpkeepPercentageDevice.push(parseFloat((data.data.list[i].jnUpkeepPercentage) || 0).toFixed(2));
                            tbUpkeepPercentageDevice.push(parseFloat(data.data.list[i].tbUpkeepPercentage || 0).toFixed(2));
                            upkeepTimelyPercentageDevice.push(parseFloat(data.data.list[i].upkeepTimelyPercentage || 0).toFixed(2));
                            inspectionCycleDevice.push((data.data.list[i].inspectionCycle || ''));
                            jnInspectionDateCountDevice.push((data.data.list[i].jnInspectionDateCount || 0));
                            jnInspectionInfoCountDevice.push((data.data.list[i].jnInspectionInfoCount || 0));
                            jnInspectionPercentageDevice.push(parseFloat((data.data.list[i].jnInspectionPercentage) || 0).toFixed(2));
                            tbInspectionPercentageDevice.push(parseFloat(data.data.list[i].tbInspectionPercentage || 0).toFixed(2));
                            inspectionTimelyPercentageDevice.push(parseFloat(data.data.list[i].inspectionTimelyPercentage || 0).toFixed(2));
                            verificationCycleDevice.push((data.data.list[i].verificationCycle || ''));
                            jnCompulsoryDateCountDevice.push((data.data.list[i].jnCompulsoryDateCount || 0));
                            jnCompulsoryVerificationCountDevice.push((data.data.list[i].jnCompulsoryVerificationCount || 0));
                            jnCompulsoryPercentageDevice.push(parseFloat((data.data.list[i].jnCompulsoryPercentage) || 0).toFixed(2));
                            tbCompulsoryPercentageDevice.push(parseFloat(data.data.list[i].tbCompulsoryPercentage || 0).toFixed(2));
                            compulsoryTimelyPercentageDevice.push(parseFloat(data.data.list[i].compulsoryTimelyPercentage || 0).toFixed(2));
                            fullNameDevice.push(data.data.list[i].name || '');
                        }
                    } else {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                    setUlDevice('desc', 0);
                    if ((!$('#modal').is(':hidden')) && ($('#modal').attr('modal') == 'device')) moredevices();

                    queryStatus.assets = true;
                    if (queryStatus.getStatus()) {
                        loading(true);
                        queryStatus.resetStatus();
                    }
                },
                failure: function (data) {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            })
        }

        $('#morehospitals').click(morehospitals);

        function morehospitals() {
            loading(function () {
                var modal = $('#modal').attr('modal', 'hospital');
                var sb = new StringBuffer();
                var data = hospitalJson;
                var table = $('#tblSort');
                table.html('<tbody></tbody>');
                var tbody = table.find('tbody');
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.yyks"/></th>");

                //表格内容
                if (title === 0) {
                    sb.append("<th class='text-right'><fmt:message key="maintenance.overview.jhbys"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.overview.sjbys"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byltb(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byjsl(%)"/></th>"
                        + "</tr></thead>");
                } else if (title === 1) {
                    sb.append("<th class='text-right'><fmt:message key="maintenance.overview.jhxjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.overview.sjxjs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjltb(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjjsl(%)"/></th>"
                        + "</tr></thead>");
                } else if (title === 2) {
                    sb.append("<th class='text-right'><fmt:message key="maintenance.overview.jhqjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.overview.sjqjs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjltb(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjjsl(%)"/></th>"
                        + "</tr></thead>");
                }
                table.prepend(sb.toString());

                groupLoading(data.length, function (min, max) {
                    var str = '';
                    if (title === 0) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick='query(\"hospital\",\"" + data[i].id + "\")'>" + (data[i].name || '') + "</td>"
                                + "<td class='total-1 text-right" + (data[i].jnUpkeepDateCount ? ' spanTitle' : '') + "' " +
                                "onclick=\"query('plan-record','{maintenanceType:1,departmentId:[" + data[i].id + "]}'," + data[i].jnUpkeepDateCount + ")\">" +
                                (data[i].jnUpkeepDateCount || 0) + "</td>"
                                + "<td class='total-2 text-right" + (data[i].jnUpkeepInfoCount ? ' spanTitle' : '') +
                                "' onclick=\"query('actual-record','{maintenanceType:1,departmentId:[" + data[i].id + "]}'," + data[i].jnUpkeepInfoCount + ")\">" +
                                (data[i].jnUpkeepInfoCount || 0) + "</td>"
                                + "<td class='total-3 text-right" + (data[i].jnUpkeepDateAssetsCount ? ' spanTitle' : '') +
                                "' onclick=\"query('plan-device','{maintenanceType:1,departmentId:[" + data[i].id + "]}'," + data[i].jnUpkeepDateAssetsCount + ")\">" +
                                (data[i].jnUpkeepDateAssetsCount || 0) + "</td>"
                                + "<td class='total-4 text-right" + (data[i].jnUpkeepInfoAssetsCount ? ' spanTitle' : '') +
                                "' onclick=\"query('actual-device','{maintenanceType:1,departmentId:[" + data[i].id + "]}'," + data[i].jnUpkeepInfoAssetsCount + ")\">" +
                                (data[i].jnUpkeepInfoAssetsCount || 0) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data[i].jnUpkeepPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-5 text-right'>" + parseFloat(data[i].tbUpkeepPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data[i].upkeepTimelyPercentage || 0).toFixed(2) + "</td>"
                                + "</tr>";

                        }
                    } else if (title === 1) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick='query(\"hospital\",\"" + data[i].id + "\")'>" + (data[i].name || '') + "</td>"
                                + "<td class='total-1 text-right" + (data[i].jnInspectionDateCount ? ' spanTitle' : '') +
                                "' onclick=\"query('plan-record','{maintenanceType:2,departmentId:[" + data[i].id + "]}'," + data[i].jnInspectionDateCount + ")\">" +
                                (data[i].jnInspectionDateCount || 0) + "</td>"
                                + "<td class='total-2 text-right" + (data[i].jnInspectionInfoCount ? ' spanTitle' : '') +
                                "' onclick=\"query('actual-record','{maintenanceType:2,departmentId:[" + data[i].id + "]}'," + data[i].jnInspectionInfoCount + ")\">" +
                                (data[i].jnInspectionInfoCount || 0) + "</td>"
                                + "<td class='total-3 text-right" + (data[i].jnInspectionDateAssetsCount ? ' spanTitle' : '') +
                                "' onclick=\"query('plan-device','{maintenanceType:2,departmentId:[" + data[i].id + "]}'," + data[i].jnInspectionDateAssetsCount + ")\">" +
                                (data[i].jnInspectionDateAssetsCount || 0) + "</td>"
                                + "<td class='total-4 text-right" + (data[i].jnInspectionInfoAssetsCount ? ' spanTitle' : '') +
                                "' onclick=\"query('actual-device','{maintenanceType:2,departmentId:[" + data[i].id + "]}'," + data[i].jnInspectionInfoAssetsCount + ")\">" +
                                (data[i].jnInspectionInfoAssetsCount || 0) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data[i].jnInspectionPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-5 text-right'>" + parseFloat(data[i].tbInspectionPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data[i].inspectionTimelyPercentage || 0).toFixed(2) + "</td>"
                                + "</tr>";
                        }
                    } else if (title === 2) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick='query(\"hospital\",\"" + data[i].id + "\")'>" + (data[i].name || '') + "</td>"
                                + "<td class='total-1 text-right" + (data[i].jnCompulsoryDateCount ? ' spanTitle' : '') +
                                "' onclick=\"query('plan-record','{maintenanceType:3,departmentId:[" + data[i].id + "]}'," + data[i].jnCompulsoryDateCount + ")\">" +
                                (data[i].jnCompulsoryDateCount || 0) + "</td>"
                                + "<td class='total-2 text-right" + (data[i].jnCompulsoryVerificationCount ? ' spanTitle' : '') +
                                "' onclick=\"query('actual-record','{maintenanceType:3,departmentId:[" + data[i].id + "]}'," + data[i].jnCompulsoryVerificationCount + ")\">" +
                                (data[i].jnCompulsoryVerificationCount || 0) + "</td>"
                                + "<td class='total-3 text-right" + (data[i].jnCompulsoryDateAssetsCount ? ' spanTitle' : '') +
                                "' onclick=\"query('plan-device','{maintenanceType:3,departmentId:[" + data[i].id + "]}'," + data[i].jnCompulsoryDateAssetsCount + ")\">" +
                                (data[i].jnCompulsoryDateAssetsCount || 0) + "</td>"
                                + "<td class='total-4 text-right" + (data[i].jnCompulsoryVerificationAssetsCount ? ' spanTitle' : '') +
                                "' onclick=\"query('actual-device','{maintenanceType:3,departmentId:[" + data[i].id + "]}'," + data[i].jnCompulsoryVerificationAssetsCount + ")\">" +
                                (data[i].jnCompulsoryVerificationAssetsCount || 0) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data[i].jnCompulsoryPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-5 text-right'>" + parseFloat(data[i].tbCompulsoryPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data[i].compulsoryTimelyPercentage || 0).toFixed(2) + "</td>"
                                + "</tr>";
                        }
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData("tblSort", true);
                });
                modal.iziModal('setTitle', '<fmt:message key="index.overview.yyks.yyksfb"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }

        $('#moredetail, #moretypes').click(function () {
            moretypes();
        });

        function moretypes(param) {
            loading(function () {
                param = $.extend({}, {
                    id: '',
                    dataJson: typeJson,
                    modal: 'modal',
                    table: 'tblSort'
                }, param);
                var data = $.extend([], param.dataJson);
                var modal = $('#' + param.modal);
                var table = $("#" + param.table);
                modal.attr('modal', 'type');
                var sb = new StringBuffer();
                table.html('<tbody></tbody>');
                var tbody = table.find('tbody');
                sb.append("<thead><tr><th class='text-center' key='name' value='<fmt:message key="share.table.tail.zj"/>'><fmt:message key="index.table.yjsb"/></th>");
                //表头
                sb.append("<th class='text-left' key='name'><fmt:message key="share.table.head.sblx"/></th>");

                //表格内容
                if (title === 0) {
                    sb.append("<th class='text-right' key='jnUpkeepDateCount' value='" + fix0(data[-1].jnUpkeepDateCount) + "'><fmt:message key="maintenance.overview.jhbys"/></th>"
                        + "<th class='text-right' key='jnUpkeepInfoCount' value='" + fix0(data[-1].jnUpkeepInfoCount) + "'><fmt:message key="maintenance.overview.sjbys"/></th>"
                        + "<th class='text-right' key='jnUpkeepDateAssetsCount' value='" + fix0(data[-1].jnUpkeepDateAssetsCount) + "'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right' key='jnUpkeepInfoAssetsCount' value='" + fix0(data[-1].jnUpkeepInfoAssetsCount) + "'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right' key='jnUpkeepPercentage' value='" + fix2(data[-1].jnUpkeepPercentage / data.length) + "'><fmt:message key="maintenance.table.byl(%)"/></th>"
                        + "<th class='text-right' key='tbUpkeepPercentage' value='" + fix2(data[-1].tbUpkeepPercentage / data.length) + "'><fmt:message key="maintenance.table.byltb(%)"/></th>"
                        + "<th class='text-right' key='upkeepTimelyPercentage' value='" + fix2(data[-1].upkeepTimelyPercentage / data.length) + "'><fmt:message key="maintenance.table.byjsl(%)"/></th>"
                        + "</tr></thead>");
                } else if (title === 1) {
                    sb.append("<th class='text-right' key='jnInspectionDateCount' value='" + fix0(data[-1].jnInspectionDateCount) + "'><fmt:message key="maintenance.overview.jhxjs"/></th>"
                        + "<th class='text-right' key='jnInspectionInfoCount' value='" + fix0(data[-1].jnInspectionInfoCount) + "'><fmt:message key="maintenance.overview.sjxjs"/></th>"
                        + "<th class='text-right' key='jnInspectionDateAssetsCount' value='" + fix0(data[-1].jnInspectionDateAssetsCount) + "'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right' key='jnInspectionInfoAssetsCount' value='" + fix0(data[-1].jnInspectionInfoAssetsCount) + "'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right' key='jnInspectionPercentage' value='" + fix2(data[-1].jnInspectionPercentage / data.length) + "'><fmt:message key="maintenance.table.xjl(%)"/></th>"
                        + "<th class='text-right' key='tbInspectionPercentage' value='" + fix2(data[-1].tbInspectionPercentage / data.length) + "'><fmt:message key="maintenance.table.xjltb(%)"/></th>"
                        + "<th class='text-right' key='inspectionTimelyPercentage' value='" + fix2(data[-1].inspectionTimelyPercentage / data.length) + "'><fmt:message key="maintenance.table.xjjsl(%)"/></th>"
                        + "</tr></thead>");
                } else if (title === 2) {
                    sb.append("<th class='text-right' key='jnCompulsoryDateCount' value='" + fix0(data[-1].jnCompulsoryDateCount) + "'><fmt:message key="maintenance.overview.jhqjs"/></th>"
                        + "<th class='text-right' key='jnCompulsoryVerificationCount' value='" + fix0(data[-1].jnCompulsoryVerificationCount) + "'><fmt:message key="maintenance.overview.sjqjs"/></th>"
                        + "<th class='text-right' key='jnCompulsoryDateAssetsCount' value='" + fix0(data[-1].jnCompulsoryDateAssetsCount) + "'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right' key='jnCompulsoryVerificationAssetsCount' value='" + fix0(data[-1].jnCompulsoryVerificationAssetsCount) + "'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right' key='jnCompulsoryPercentage' value='" + fix2(data[-1].jnCompulsoryPercentage / data.length) + "'><fmt:message key="maintenance.table.qjl(%)"/></th>"
                        + "<th class='text-right' key='tbCompulsoryPercentage' value='" + fix2(data[-1].tbCompulsoryPercentage / data.length) + "'><fmt:message key="maintenance.table.qjltb(%)"/></th>"
                        + "<th class='text-right' key='compulsoryTimelyPercentage' value='" + fix2(data[-1].compulsoryTimelyPercentage / data.length) + "'><fmt:message key="maintenance.table.qjjsl(%)"/></th>"
                        + "</tr></thead>");
                }
                table.prepend(sb.toString());
                groupLoading(data.length, function (min, max) {
                    var str = '';
                    if (title === 0) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center border-bottom' rowspan='" + (data[i].list.length + 1) + "'>" + (data[i][lang === 'en' ? 'enName' : 'name'] || '') + "</td>"
                                + "<td class='no-cal'><fmt:message key="share.table.tail.xj"/></td>"
                                + "<td class='total-1 text-right" + (data[i].jnUpkeepDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].id + "]}'," + data[i].jnUpkeepDateCount + ")\">" + (data[i].jnUpkeepDateCount || 0) + "</td>"
                                + "<td class='total-2 text-right" + (data[i].jnUpkeepInfoCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].id + "]}'," + data[i].jnUpkeepInfoCount + ")\">" + (data[i].jnUpkeepInfoCount || 0) + "</td>"
                                + "<td class='total-3 text-right" + (data[i].jnUpkeepDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].id + "]}'," + data[i].jnUpkeepDateAssetsCount + ")\">" + (data[i].jnUpkeepDateAssetsCount || 0) + "</td>"
                                + "<td class='total-4 text-right" + (data[i].jnUpkeepInfoAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].id + "]}'," + data[i].jnUpkeepInfoAssetsCount + ")\">" + (data[i].jnUpkeepInfoAssetsCount || 0) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data[i].jnUpkeepPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-5 text-right'>" + parseFloat(data[i].tbUpkeepPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data[i].upkeepTimelyPercentage || 0).toFixed(2) + "</td>"
                                + "</tr>"
                                + (function () {
                                    var str1 = '';
                                    for (var j = 0; j < data[i].list.length; j++) {
                                        str1 += "<tr" + (j === (data[i].list.length - 1) ? ' class="border-bottom"' : '') + ">";
                                        str1 += "<td class='no-cal spanTitle' onclick='query(\"type\",\"" + data[i].list[j].id + "\")'>" + (data[i].list[j][lang === 'en' ? 'enName' : 'name'] || '') + "</td>"
                                            + "<td class='total-1 text-right" + (data[i].list[j].jnUpkeepDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnUpkeepDateCount + ")\">" + (data[i].list[j].jnUpkeepDateCount || 0) + "</td>"
                                            + "<td class='total-2 text-right" + (data[i].list[j].jnUpkeepInfoCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnUpkeepInfoCount + ")\">" + (data[i].list[j].jnUpkeepInfoCount || 0) + "</td>"
                                            + "<td class='total-3 text-right" + (data[i].list[j].jnUpkeepDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnUpkeepDateAssetsCount + ")\">" + (data[i].list[j].jnUpkeepDateAssetsCount || 0) + "</td>"
                                            + "<td class='total-4 text-right" + (data[i].list[j].jnUpkeepInfoAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:1,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnUpkeepInfoAssetsCount + ")\">" + (data[i].list[j].jnUpkeepInfoAssetsCount || 0) + "</td>"
                                            + "<td class='avg-4 text-right'>" + parseFloat(data[i].list[j].jnUpkeepPercentage || 0).toFixed(2) + "</td>"
                                            + "<td class='avg-5 text-right'>" + parseFloat(data[i].list[j].tbUpkeepPercentage || 0).toFixed(2) + "</td>"
                                            + "<td class='avg-2 text-right'>" + parseFloat(data[i].list[j].upkeepTimelyPercentage || 0).toFixed(2) + "</td>"
                                            + "</tr>";
                                    }
                                    return str1;
                                })(i);
                        }
                    } else if (title === 1) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center border-bottom' rowspan='" + (data[i].list.length + 1) + "'>" + (data[i].name || '') + "</td>"
                                + "<td class='no-cal'><fmt:message key="share.table.tail.xj"/></td>"
                                + "<td class='total-1 text-right" + (data[i].jnInspectionDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].id + "]}'," + data[i].jnInspectionDateCount + ")\">" + (data[i].jnInspectionDateCount || 0) + "</td>"
                                + "<td class='total-2 text-right" + (data[i].jnInspectionInfoCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].id + "]}'," + data[i].jnInspectionInfoCount + ")\">" + (data[i].jnInspectionInfoCount || 0) + "</td>"
                                + "<td class='total-3 text-right" + (data[i].jnInspectionDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].id + "]}'," + data[i].jnInspectionDateAssetsCount + ")\">" + (data[i].jnInspectionDateAssetsCount || 0) + "</td>"
                                + "<td class='total-4 text-right" + (data[i].jnInspectionInfoAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].id + "]}'," + data[i].jnInspectionInfoAssetsCount + ")\">" + (data[i].jnInspectionInfoAssetsCount || 0) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data[i].jnInspectionPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-5 text-right'>" + parseFloat(data[i].tbInspectionPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data[i].inspectionTimelyPercentage || 0).toFixed(2) + "</td>"
                                + "</tr>"
                                + (function () {
                                    var str1 = '';
                                    for (var j = 0; j < data[i].list.length; j++) {
                                        str1 += "<tr" + (j === (data[i].list.length - 1) ? ' class="border-bottom"' : '') + ">";
                                        str1 += "<td class='no-cal spanTitle' onclick='query(\"type\",\"" + data[i].list[j].id + "\")'>" + (data[i].list[j].name || '') + "</td>"
                                            + "<td class='total-1 text-right" + (data[i].list[j].jnInspectionDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnInspectionDateCount + ")\">" + (data[i].list[j].jnInspectionDateCount || 0) + "</td>"
                                            + "<td class='total-2 text-right" + (data[i].list[j].jnInspectionInfoCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnInspectionInfoCount + ")\">" + (data[i].list[j].jnInspectionInfoCount || 0) + "</td>"
                                            + "<td class='total-3 text-right" + (data[i].list[j].jnInspectionDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnInspectionDateAssetsCount + ")\">" + (data[i].list[j].jnInspectionDateAssetsCount || 0) + "</td>"
                                            + "<td class='total-4 text-right" + (data[i].list[j].jnInspectionInfoAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:2,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnInspectionInfoAssetsCount + ")\">" + (data[i].list[j].jnInspectionInfoAssetsCount || 0) + "</td>"
                                            + "<td class='avg-4 text-right'>" + parseFloat(data[i].list[j].jnInspectionPercentage || 0).toFixed(2) + "</td>"
                                            + "<td class='avg-5 text-right'>" + parseFloat(data[i].list[j].tbInspectionPercentage || 0).toFixed(2) + "</td>"
                                            + "<td class='avg-2 text-right'>" + parseFloat(data[i].list[j].inspectionTimelyPercentage || 0).toFixed(2) + "</td>"
                                            + "</tr>";
                                    }
                                    return str1;
                                })(i);
                        }
                    } else if (title === 2) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center border-bottom' rowspan='" + (data[i].list.length + 1) + "'>" + (data[i].name || '') + "</td>"
                                + "<td class='no-cal'><fmt:message key="share.table.tail.xj"/></td>"
                                + "<td class='total-1 text-right" + (data[i].jnCompulsoryDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].id + "]}'," + data[i].jnCompulsoryDateCount + ")\">" + (data[i].jnCompulsoryDateCount || 0) + "</td>"
                                + "<td class='total-2 text-right" + (data[i].jnCompulsoryVerificationCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].id + "]}'," + data[i].jnCompulsoryVerificationCount + ")\">" + (data[i].jnCompulsoryVerificationCount || 0) + "</td>"
                                + "<td class='total-3 text-right" + (data[i].jnCompulsoryDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].id + "]}'," + data[i].jnCompulsoryDateAssetsCount + ")\">" + (data[i].jnCompulsoryDateAssetsCount || 0) + "</td>"
                                + "<td class='total-4 text-right" + (data[i].jnCompulsoryVerificationAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].id + "]}'," + data[i].jnCompulsoryVerificationAssetsCount + ")\">" + (data[i].jnCompulsoryVerificationAssetsCount || 0) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data[i].jnCompulsoryPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-5 text-right'>" + parseFloat(data[i].tbCompulsoryPercentage || 0).toFixed(2) + "</td>"
                                + "<td class='avg-2 text-right'>" + parseFloat(data[i].compulsoryTimelyPercentage || 0).toFixed(2) + "</td>"
                                + "</tr>"
                                + (function () {
                                    var str1 = '';
                                    for (var j = 0; j < data[i].list.length; j++) {
                                        str1 += "<tr" + (j === (data[i].list.length - 1) ? ' class="border-bottom"' : '') + ">";
                                        str1 += "<td class='no-cal spanTitle' onclick='query(\"type\",\"" + idsType[i] + "\")'>" + (data[i].list[j].name || '') + "</td>"
                                            + "<td class='total-1 text-right" + (data[i].list[j].jnCompulsoryDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnCompulsoryDateCount + ")\">" + (data[i].list[j].jnCompulsoryDateCount || 0) + "</td>"
                                            + "<td class='total-2 text-right" + (data[i].list[j].jnCompulsoryVerificationCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnCompulsoryVerificationCount + ")\">" + (data[i].list[j].jnCompulsoryVerificationCount || 0) + "</td>"
                                            + "<td class='total-3 text-right" + (data[i].list[j].jnCompulsoryDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnCompulsoryDateAssetsCount + ")\">" + (data[i].list[j].jnCompulsoryDateAssetsCount || 0) + "</td>"
                                            + "<td class='total-4 text-right" + (data[i].list[j].jnCompulsoryVerificationAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{" + (param.id ? 'monthId:' + param.id + ',' : '') + "maintenanceType:3,typeId:[" + data[i].list[j].id + "]}'," + data[i].list[j].jnCompulsoryVerificationAssetsCount + ")\">" + (data[i].list[j].jnCompulsoryVerificationAssetsCount || 0) + "</td>"
                                            + "<td class='avg-4 text-right'>" + parseFloat(data[i].list[j].jnCompulsoryPercentage || 0).toFixed(2) + "</td>"
                                            + "<td class='avg-5 text-right'>" + parseFloat(data[i].list[j].tbCompulsoryPercentage || 0).toFixed(2) + "</td>"
                                            + "<td class='avg-2 text-right'>" + parseFloat(data[i].list[j].compulsoryTimelyPercentage || 0).toFixed(2) + "</td>"
                                            + "</tr>";
                                    }
                                    return str1;
                                })(i);
                        }
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData({tableId: param.table, isType: true, param: param}, true);
                });
                modal.iziModal('setTitle', '<fmt:message key="share.table.title.sblxfbxq"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }

        $('#moredevices').click(moredevices);

        function moredevices() {
            loading(function () {
                var modal = $('#modal').attr('modal', 'device');
                var sb = new StringBuffer();
                var table = $("#tblSort").html('<tbody></tbody>');
                var tbody = table.find('tbody');
                var data = deviceJson;
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbmc"/></th>");

                //表格内容
                if (title === 0) {
                    sb.append("<th class='text-left'><fmt:message key="share.title.sblx"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.ssks"/></th>"
                        + "<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.snbh"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.zcbh"/></th>"
                        + "<th class='text-left'><fmt:message key="maintenance.assets.byzq"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.overview.jhbys"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.overview.sjbys"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byltb(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byjsl(%)"/></th>"
                        + "</tr></thead>");
                } else if (title === 1) {
                    sb.append("<th class='text-left'><fmt:message key="share.title.sblx"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.ssks"/></th>"
                        + "<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.snbh"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.zcbh"/></th>"
                        + "<th class='text-left'><fmt:message key="maintenance.assets.xjzq"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.jhxjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.sjxjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjltb(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjjsl(%)"/></th>"
                        + "</tr></thead>");
                } else if (title === 2) {
                    sb.append("<th class='text-left'><fmt:message key="share.title.sblx"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.ssks"/></th>"
                        + "<th class='text-left'><fmt:message key="share.table.head.sbcj"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.snbh"/></th>"
                        + "<th class='text-left'><fmt:message key="share.assets.zcbh"/></th>"
                        + "<th class='text-left'><fmt:message key="maintenance.assets.qjzq"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.jhqjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.sjqjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjltb(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjjsl(%)"/></th>"
                        + "</tr></thead>");
                }
                table.prepend(sb.toString());

                groupLoading(data.length, function (min, max) {
                    var str = '';
                    if (title === 0) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick='query(\"device\",\"" + idsDevice[i] + "\")' title='" + xAxisDevice[i] + "'>" + xAxisDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + fixStr(data[i].firstTypeName) + "</td>"
                                + "<td class='no-cal text-left'>" + departmentNameDevice[i] + "</td>"
                                + "<td class='no-cal' title='" + manufacturerDevice[i] + "'>" + manufacturerDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + snDevice[i] + "</td>"
                                + "<td class='no-cal text-left' title='" + assetsNoDevice[i] + "'>" + assetsNoDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + upkeepCycleDevice[i] + "</td>"
                                + "<td class='total-2 text-right'>" + jnUpkeepDateCountDevice[i] + "</td>"
                                + "<td class='total-3 text-right'>" + jnUpkeepInfoCountDevice[i] + "</td>"
                                + "<td class='avg-4 text-right'>" + jnUpkeepPercentageDevice[i] + "</td>"
                                + "<td class='avg-5 text-right yoy'>" + tbUpkeepPercentageDevice[i] + "</td>"
                                + "<td class='avg-6 text-right'>" + upkeepTimelyPercentageDevice[i] + "</td>"
                                + "</tr>";
                        }
                    } else if (title === 1) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick='query(\"device\",\"" + idsDevice[i] + "\")' title='" + xAxisDevice[i] + "'>" + xAxisDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + fixStr(data[i].firstTypeName) + "</td>"
                                + "<td class='no-cal text-left'>" + departmentNameDevice[i] + "</td>"
                                + "<td class='no-cal' title='" + manufacturerDevice[i] + "'>" + manufacturerDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + snDevice[i] + "</td>"
                                + "<td class='no-cal text-left' title='" + assetsNoDevice[i] + "'>" + assetsNoDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + inspectionCycleDevice[i] + "</td>"
                                + "<td class='total-2 text-right'>" + jnInspectionDateCountDevice[i] + "</td>"
                                + "<td class='total-3 text-right'>" + jnInspectionInfoCountDevice[i] + "</td>"
                                + "<td class='avg-4 text-right'>" + jnInspectionPercentageDevice[i] + "</td>"
                                + "<td class='avg-5 text-right yoy'>" + tbInspectionPercentageDevice[i] + "</td>"
                                + "<td class='avg-6 text-right'>" + inspectionTimelyPercentageDevice[i] + "</td>"
                                + "</tr>";
                        }
                    } else if (title === 2) {
                        for (var i = min; i < max; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick='query(\"device\",\"" + idsDevice[i] + "\")' title='" + xAxisDevice[i] + "'>" + xAxisDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + fixStr(data[i].firstTypeName) + "</td>"
                                + "<td class='no-cal text-left'>" + departmentNameDevice[i] + "</td>"
                                + "<td class='no-cal' title='" + manufacturerDevice[i] + "'>" + manufacturerDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + snDevice[i] + "</td>"
                                + "<td class='no-cal text-left' title='" + assetsNoDevice[i] + "'>" + assetsNoDevice[i] + "</td>"
                                + "<td class='no-cal text-left'>" + verificationCycleDevice[i] + "</td>"
                                + "<td class='total-2 text-right'>" + jnCompulsoryDateCountDevice[i] + "</td>"
                                + "<td class='total-3 text-right'>" + jnCompulsoryVerificationCountDevice[i] + "</td>"
                                + "<td class='avg-4 text-right'>" + jnCompulsoryPercentageDevice[i] + "</td>"
                                + "<td class='avg-5 text-right yoy'>" + tbCompulsoryPercentageDevice[i] + "</td>"
                                + "<td class='avg-6 text-right'>" + compulsoryTimelyPercentageDevice[i] + "</td>"
                                + "</tr>";
                        }
                    }
                    tbody.append(str);
                    if (max === data.length)
                        calTableData('tblSort', true);
                });
                modal.iziModal('setTitle', '<fmt:message key="share.table.title.sbfbxq"/>');
                modal.iziModal('open', this);
                loading(true);
            });
        }

        function query(tag, id, detailId) {
            if (detailId) {
                if (tag == 'hospital') {
                    departmentName = [id];
                    typeId = $('.select_type').val() ? $('.select_type').val() : '';
                    queryMaintenceData(detailId);
                } else if (tag == 'type') {
                    departmentName = $('.select_hospital').val() ? $('.select_hospital').val() : '';
                    typeId = [id];
                    queryMaintenceData(detailId);
                } else if (tag === 'plan-record') {
                    queryRecordTable($.extend({}, string2json(id)), 'plan');
                } else if (tag === 'actual-record') {
                    queryRecordTable($.extend({}, string2json(id)), 'actual');
                } else if (tag === 'plan-device') {
                    queryDeviceTable($.extend({}, string2json(id)), 'plan');
                } else if (tag === 'actual-device') {
                    queryDeviceTable($.extend({}, string2json(id)), 'actual');
                }
            } else if (tag == 'hospital') {
                location.href = '<%=basePath%>/charts/hospital/type-index/page?departmentId=' + id + '&hospitalId=' + hspId;
            } else if (tag == 'type') {
                location.href = '<%=basePath%>/charts/hospital/model-index/page?typeId=' + id + '&hospitalId=' + hspId;
            } else if (tag == 'device' && deviceRedirect) {
                window.open('<%=basePath%>/charts/overview/assets/page?deviceId=' + id);
            } else if (tag === 'year') {
                publicAjax('<%=basePath%>/charts/hospital/maintenance/type', 'post', {
                    hospitalId: hspId,
                    departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                    riskId: riskId ? JSON.stringify(riskId) : '',
                    typeId: typeId ? JSON.stringify(typeId) : '',
                    brandId: brandId ? JSON.stringify(brandId) : '',
                    year: year ? JSON.stringify(year) : '',
                    monthId: id,
                    enableYearStart: enableYearStart,
                    enableYearEnd: enableYearEnd,
                    priceStart: priceStart,
                    priceEnd: priceEnd,
                    ageLimitStart: ageLimitStart,
                    ageLimitEnd: ageLimitEnd,
                    maintenanceType: maintenanceType
                }, function (data) {
                    if (data.ret && data.data && data.data.list) {
                        typeYear = (data.data.list || []).sortByKey('jnUpkeepPercentage').calTotal();
                    } else {
                        typeYear = [];
                    }
                    moretypes({
                        id: id,
                        dataJson: typeYear,
                        modal: 'typeModal',
                        table: 'typeTable'
                    });
                    $('#modal').iziModal('open');
                });
            }
        }

        function queryMaintenceData(detailId) {
            if ($(".detail-tr-" + detailId).hasClass("hide")) {
                $(".detail-tr-" + detailId).removeClass("hide");
                $("#detail-" + detailId).removeClass("fa-plus");
                $("#detail-" + detailId).addClass("fa-minus");
                var url;
                if (title === 0) {
                    url = '<%=basePath%>/charts/hospital/maintenance/queryUpkeepData';
                } else if (title === 1) {
                    url = '<%=basePath%>/charts/hospital/maintenance/queryInspectionData';
                } else if (title === 2) {
                    url = '<%=basePath%>/charts/hospital/maintenance/queryCompulsoryData';
                }
                $.ajax({
                    type: "POST",
                    url: url,
                    data: {
                      hospitalId: hspId,
                        riskId: riskId ? JSON.stringify(riskId) : '',
                        departmentId: departmentName ? JSON.stringify(departmentName) : '',
                        typeId: typeId ? JSON.stringify(typeId) : '',
                        brandId: brandId ? JSON.stringify(brandId) : '',
                        year: year ? JSON.stringify(year) : '',
                        monthId: monthId ? JSON.stringify(monthId) : '',
                        enableYearStart: enableYearStart,
                        enableYearEnd: enableYearEnd,
                        priceStart: priceStart,
                        priceEnd: priceEnd,
                        ageLimitStart: ageLimitStart,
                        ageLimitEnd: ageLimitEnd,
                        maintenanceType: maintenanceType
                    },
                    dataType: "json",
                    success: function (data) {
                        if (data.ret == 1) {
                            data.data = data.data || {list: []};
                            if (data.data && data.data.list.length) {
                                var sb = new StringBuffer();
                                $("#detail-table-" + detailId).html('<tbody id="table_data"></tbody>');
                                sb.append("<thead><tr><th class='text-center'>#</th>");
                                //表头
                                sb.append("<th class='text-left'><fmt:message key="share.table.head.sbmc"/></th>");

                                //表格内容
                                sb.append("<th class='text-left'><fmt:message key="share.assets.sbxh"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.ssks"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.snbh"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.zcbh"/></th>"
                                    + "<th class='text-left'><fmt:message key="maintenance.record.cj"/></th>"
                                    + "<th class='text-left'><fmt:message key="maintenance.record.fws"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.sbje(wy)"/></th>"
                                    + "<th class='text-left'><fmt:message key="maintenance.record.gcs"/></th>"
                                    + "<th class='text-left'><fmt:message key="maintenance.record.xhpjsl"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.ysysj(n)"/></th>"
                                    + "<th class='text-left'><fmt:message key="share.assets.nxzs"/></th>"
                                    + "</tr></thead>");
                                $("#detail-table-" + detailId).prepend(sb.toString());
                                for (var i = 0; i < data.data.list.length; i++) {
                                    $("#detail-table-" + detailId + " tbody").append("<tr>"
                                        + "<td class='text-center'>" + (i + 1) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].assetsName || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].model || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].departmentName || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                        + "<td class='text-left' title='" + (data.data.list[i].assetsNo || '') + "'>" + (data.data.list[i].assetsNo || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].manufacturerName || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].serviceProviderName || '') + "</td>"
                                        + "<td class='text-right'>" + parseFloat((data.data.list[i].price / CONST) || 0).toFixed(2) + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].engineer || '') + "</td>"
                                        + "<td class='text-left'>" + (data.data.list[i].partQuantity || '') + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].usedTime || 0).toFixed(2) + "</td>"
                                        + "<td class='text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                        + "</tr>");
                                }

                            } else {
                                $("#detail-table-" + detailId).html('<p><fmt:message key="share.talbe.myxgjl"/></p>');
                            }
                        } else {
                            flavrShowByTime(data.msg, null, "danger", false);
                        }
                    },
                    failure: function () {
                        flavrShowByTime(data.msg, null, "danger", false);
                    }
                })
            } else {
                $(".detail-tr-" + detailId).addClass("hide");
                $("#detail-" + detailId).addClass("fa-plus");
                $("#detail-" + detailId).removeClass("fa-minus");
            }
        }

        function queryRecordTable(param, type) {
            var param = param || {};
            var url;
            if (type === 'plan') {
                url = '<%=basePath%>/charts/hospital/maintenance/plan/record';
            } else if (type === 'actual') {
                if (maintenanceType === 1) {
                    url = '<%=basePath%>/charts/hospital/maintenance/queryUpkeepData';
                } else if (maintenanceType === 2) {
                    url = '<%=basePath%>/charts/hospital/maintenance/queryInspectionData';
                } else if (maintenanceType === 3) {
                    url = '<%=basePath%>/charts/hospital/maintenance/queryCompulsoryData';
                }

            }
            publicAjax(url, 'post', $.extend({}, {
                hospitalId: hspId,
                riskId: riskId ? JSON.stringify(riskId) : '',
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                year: year ? JSON.stringify(year) : '',
                monthId: monthId ? JSON.stringify(monthId) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd,
                maintenanceType: maintenanceType
            }, param), function (data) {
                if (data.ret) {
                    data.data = data.data || {list: []};
                    if (data.data.list.length) {
                        if (!$('#deviceModal').length) {
                            $('body').append('<div id="deviceModal" class="modal" style="padding-top: 58px;height: 100%;box-sizing: border-box;display: none;">' +
                                '<div class="box-body no-padding">' +
                                '   <table id="deviceTable" class="table table-bordered table-striped table-hover table-responsive">' +
                                '       <thead></thead>' +
                                '       <tbody id="device_data"></tbody>' +
                                '   </table>' +
                                '</div></div>');
                            $("#deviceModal").iziModal({
                                title: '<fmt:message key="maintain.overview.wxjl"/>',
                                headerColor: '#222431',
                                width: '100%',
                                radius: 3,
                                zindex: 1090,
                                navigateCaption: true,
                                navigateArrows: true, // closeToModal, closeScreenEdge
                                history: false,
                                restoreDefaultContent: false,
                                autoOpen: false, // Boolean, Number
                                bodyOverflow: true,
                                fullscreen: true,
                                overlayColor: 'rgba(0, 0, 0, 0)',
                                transitionIn: 'comingIn',
                                transitionOut: 'comingOut',
                                transitionInOverlay: 'fadeIn',
                                transitionOutOverlay: 'fadeOut',
                                onOpening: function () {
                                    $('#deviceModal').find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#assetModal\')" title="<fmt:message key="share.sift.dc"/>"><i class="fa fa-upload"></i></a>');
                                    $('#deviceModal .box-body').height($('#deviceModal').height() - 44);
                                },
                                onClosed: function () {
                                    clearTable($('#deviceModal'));
                                }
                            });
                        }

                        $('#deviceTable').find('thead').html('<th class="text-center">#</th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbmc"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbxh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.title.sblx"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.ssks"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.snbh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbcj"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.sbje(wy)"/></th>' +
                            (function () {
                                var strMaintenanceType = '';
                                if (maintenanceType == 1) {
                                    $("#deviceModal").iziModal('setTitle', '<fmt:message key="share.talbe.sbbyxq"/>');
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.byzq"/></th>';
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.jhbysj"/></th>';
                                    strMaintenanceType += (type !== 'plan' ? '<th class="text-left"><fmt:message key="maintenance.assets.sjbysj"/></th>' : '');
                                } else if (maintenanceType == 2) {
                                    $("#deviceModal").iziModal('setTitle', '<fmt:message key="share.talbe.sbxjxq"/>');
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.xjzq"/></th>';
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.jhxjsj"/></th>';
                                    strMaintenanceType += (type !== 'plan' ? '<th class="text-left"><fmt:message key="maintenance.assets.sjxjsj"/></th>' : '');
                                } else if (maintenanceType == 3) {
                                    $("#deviceModal").iziModal('setTitle', '<fmt:message key="share.talbe.sbqjxq"/>');
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.qjzq"/></th>';
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.jhqjsj"/></th>';
                                    strMaintenanceType += (type !== 'plan' ? '<th class="text-left"><fmt:message key="maintenance.assets.sjqjsj"/></th>' : '');
                                }
                                return strMaintenanceType;
                            })() +
                            '<th class="text-left"><fmt:message key="maintian.record.ewm"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.sbqyrq"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.ysysj(n)"/></th>' +
                            '<th class="text-right"><fmt:message key="share.sift.nxzs"/></th></tr>');

                        var str = '';
                        for (var i = 0; i < data.data.list.length; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick=query(\"device\",\"" + data.data.list[i].id + "\") title='" + (data.data.list[i].assetsName || '') + "'>" + (data.data.list[i].assetsName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].model || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].firstTypeName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].departmentName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].manufacturerName || '') + "</td>"
                                + "<td class='total-1 text-right'>" + parseFloat(data.data.list[i].price / CONST || 0).toFixed(2) + "</td>"
                                + (function () {
                                    var strMaintenanceType = '';
                                    if (maintenanceType === 1) {
                                        strMaintenanceType += "<td class='no-cal text-left'>" + (data.data.list[i].upkeepCycle || '') + "</td>";
                                    } else if (maintenanceType === 2) {
                                        strMaintenanceType += "<td class='no-cal text-left'>" + (data.data.list[i].inspectionCycle || '') + "</td>";
                                    } else if (maintenanceType === 3) {
                                        strMaintenanceType += "<td class='no-cal text-left'>" + (data.data.list[i].inspectionCycle || '') + "</td>";
                                    }
                                    strMaintenanceType += "<td class='no-cal text-left'>" +  fixStr(data.data.list[i].expectedDate) + "</td>";
                                    strMaintenanceType += (type !== 'plan' ? "<td class='no-cal text-left'>" + fixStr(data.data.list[i].completeDate) + "</td>" : '');
                                    return strMaintenanceType;
                                })()
                                + "<td class='no-cal text-left'>" + (data.data.list[i].qrcode || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].enableDate || '') + "</td>"
                                + "<td class='avg-3 text-right'>" + parseFloat(data.data.list[i].usedTime || 0).toFixed(2) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                + "</tr>";
                        }

                        $('#device_data').html(str).siblings('tfoot').empty();
                        calTableData('deviceTable', true);
                        $("#deviceModal").iziModal('open');

                    }
                } else {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            });
        }

        function queryDeviceTable(param, type) {
            var param = param || {};
            var url;
            if (type === 'plan') {
                url = '<%=basePath%>/charts/hospital/maintenance/plan/device';
            } else if (type === 'actual') {
                url = '<%=basePath%>/charts/hospital/maintenance/actual/device';
            }
            publicAjax(url, 'post', $.extend({}, {
                hospitalId: hspId,
                riskId: riskId ? JSON.stringify(riskId) : '',
                departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                typeId: typeId ? JSON.stringify(typeId) : '',
                brandId: brandId ? JSON.stringify(brandId) : '',
                year: year ? JSON.stringify(year) : '',
                monthId: monthId ? JSON.stringify(monthId) : '',
                enableYearStart: enableYearStart,
                enableYearEnd: enableYearEnd,
                priceStart: priceStart,
                priceEnd: priceEnd,
                ageLimitStart: ageLimitStart,
                ageLimitEnd: ageLimitEnd,
                maintenanceType: maintenanceType
            }, param), function (data) {
                if (data.ret) {
                    data.data = data.data || {list: []};
                    if (data.data.list.length) {
                        if (!$('#deviceModal').length) {
                            $('body').append('<div id="deviceModal" class="modal" style="padding-top: 58px;height: 100%;box-sizing: border-box;display: none;">' +
                                '<div class="box-body no-padding">' +
                                '   <table id="deviceTable" class="table table-bordered table-striped table-hover table-responsive">' +
                                '       <thead></thead>' +
                                '       <tbody id="device_data"></tbody>' +
                                '   </table>' +
                                '</div></div>');
                            $("#deviceModal").iziModal({
                                title: '<fmt:message key="maintain.overview.wxjl"/>',
                                headerColor: '#222431',
                                width: '100%',
                                radius: 3,
                                zindex: 1090,
                                navigateCaption: true,
                                navigateArrows: true, // closeToModal, closeScreenEdge
                                history: false,
                                restoreDefaultContent: false,
                                autoOpen: false, // Boolean, Number
                                bodyOverflow: true,
                                fullscreen: true,
                                overlayColor: 'rgba(0, 0, 0, 0)',
                                transitionIn: 'comingIn',
                                transitionOut: 'comingOut',
                                transitionInOverlay: 'fadeIn',
                                transitionOutOverlay: 'fadeOut',
                                onOpening: function () {
                                    $('#deviceModal').find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#assetModal\')" title="<fmt:message key="share.sift.dc"/>"><i class="fa fa-upload"></i></a>');
                                    $('#deviceModal .box-body').height($('#deviceModal').height() - 44);
                                },
                                onClosed: function () {
                                    clearTable($('#deviceModal'));
                                }
                            });
                        }

                        $('#deviceTable').find('thead').html('<th class="text-center">#</th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbmc"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbxh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.title.sblx"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.ssks"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.snbh"/></th>' +
                            '<th class="text-left"><fmt:message key="share.table.head.sbcj"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.sbje(wy)"/></th>' +
                            (function () {
                                var strMaintenanceType = '';
                                if (maintenanceType == 1) {
                                    $("#deviceModal").iziModal('setTitle', '<fmt:message key="share.talbe.sbbyxq"/>\t');
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.byzq"/></th>';
                                } else if (maintenanceType == 2) {
                                    $("#deviceModal").iziModal('setTitle', '<fmt:message key="share.talbe.sbxjxq"/>');
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.xjzq"/></th>';
                                } else if (maintenanceType == 3) {
                                    $("#deviceModal").iziModal('setTitle', '<fmt:message key="share.talbe.sbqjxq"/>');
                                    strMaintenanceType += '<th class="text-left"><fmt:message key="maintenance.assets.qjzq"/></th>';
                                }
                                return strMaintenanceType;
                            })() +
                            '<th class="text-left"><fmt:message key="maintian.record.ewm"/></th>' +
                            '<th class="text-left"><fmt:message key="share.assets.sbqyrq"/></th>' +
                            '<th class="text-right"><fmt:message key="share.assets.ysysj(n)"/></th>' +
                            '<th class="text-right"><fmt:message key="share.sift.nxzs"/></th></tr>');

                        var str = '';
                        for (var i = 0; i < data.data.list.length; i++) {
                            str += "<tr>"
                                + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                                + "<td class='no-cal spanTitle' onclick=query(\"device\",\"" + data.data.list[i].id + "\") title='" + (data.data.list[i].assetsName || '') + "'>" + (data.data.list[i].assetsName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].model || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].firstTypeName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].departmentName || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].sn || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].manufacturerName || '') + "</td>"
                                + "<td class='total-1 text-right'>" + parseFloat(data.data.list[i].price / CONST || 0).toFixed(2) + "</td>"
                                + (function () {
                                    var strMaintenanceType = '';
                                    if (maintenanceType === 1) {
                                        strMaintenanceType += "<td class='no-cal text-left'>" + (data.data.list[i].upkeepCycle || '') + "</td>";
                                    } else if (maintenanceType === 2) {
                                        strMaintenanceType += "<td class='no-cal text-left'>" + (data.data.list[i].inspectionCycle || '') + "</td>";
                                    } else if (maintenanceType === 3) {
                                        strMaintenanceType += "<td class='no-cal text-left'>" + (data.data.list[i].verificationCycle || '') + "</td>";
                                    }
                                    return strMaintenanceType;
                                })()
                                + "<td class='no-cal text-left'>" + (data.data.list[i].qrcode || '') + "</td>"
                                + "<td class='no-cal text-left'>" + (data.data.list[i].enableDate || '') + "</td>"
                                + "<td class='avg-3 text-right'>" + parseFloat(data.data.list[i].usedTime || 0).toFixed(2) + "</td>"
                                + "<td class='avg-4 text-right'>" + parseFloat(data.data.list[i].ageLimitMeasure || 0).toFixed(2) + "</td>"
                                + "</tr>";
                        }

                        $('#device_data').html(str).siblings('tfoot').empty();
                        calTableData('deviceTable', true);
                        $("#deviceModal").iziModal('open');

                    }
                } else {
                    flavrShowByTime(data.msg, null, "danger", false);
                }
            });
        }

        $('.option_overyear').click(function () {
            if ($(this).hasClass('active')) {
                $('#moredetail').html('<fmt:message key="charts.title.sblxfb"/>').off().on('click', moretypes);
                $(this).html('<fmt:message key="charts.button.yfxs"/>').removeClass('active');
                showYearTop5();
                chart.clear();
                chart.setOption(optionB1);
            } else {
                $(this).html('<fmt:message key="charts.button.qbxs"/>').addClass('active');
                showYearTop5(true);

                loading(function () {
                    $('#moredetail').html('<fmt:message key="share.table.title.yffb"/>').off().on('click', moreyear);
                    idsB = [];
                    xAxisB = [];
                    upkeepDateCountB = [];             // 计划保养数
                    upkeepInfoCountB = [];             // 实际保养数
                    upkeepPercentageB = [];            // 保养率
                    upkeepTimelyCountB = [];             //
                    upkeepUntimelyCountB = [];          //
                    upkeepTimelyPercentageB = [];        // 保养及时率
                    inspectionDateCountB = [];         //  计划巡检数
                    inspectionInfoCountB = [];         // 实际巡检数
                    inspectionPercentageB = [];        // 巡检率
                    inspectionTimelyCountB = [];         //
                    inspectionUntimelyCountB = [];              //
                    inspectionTimelyPercentageB = [];    // 巡检及时率
                    compulsoryDateCountB = [];         // 计划强检数
                    compulsoryVerificationCountB = []; // 实际强检数
                    compulsoryPercentageB = [];        // 强检率
                    compulsoryTimelyCountB = [];    // sdd
                    compulsoryUntimelyCountB = [];    //dsad
                    compulsoryTimelyPercentageB = [];    // 强检及时率
                    $("#ul_year").html('');

                    yearJson = [];
                    $.ajax({
                        url: '<%=basePath%>/charts/hospital/maintenance/month-trend',
                        data: {
                            hospitalId: hspId,
                            departmentId: hospitalId ? JSON.stringify(hospitalId) : '',
                            riskId: riskId ? JSON.stringify(riskId) : '',
                            typeId: typeId ? JSON.stringify(typeId) : '',
                            brandId: brandId ? JSON.stringify(brandId) : '',
                            year: year ? JSON.stringify(year) : '',
                            monthId: monthId ? JSON.stringify(monthId) : '',
                            enableYearStart: enableYearStart,
                            enableYearEnd: enableYearEnd,
                            priceStart: priceStart,
                            priceEnd: priceEnd,
                            ageLimitStart: ageLimitStart,
                            ageLimitEnd: ageLimitEnd,
                            maintenanceType: maintenanceType
                        },
                        type: 'post',
                        success: function (data) {
                            if (data.ret) {
                                data.data = data.data || {list: []};
                                yearJson = data.data.list.calTotal();
                                for (var i = 0; i < data.data.list.length; i++) {
                                    idsB.push(data.data.list[i].month);
                                    xAxisB.push(data.data.list[i].monthName);
                                    upkeepDateCountB.push(data.data.list[i].upkeepDateCount || 0);
                                    upkeepInfoCountB.push(data.data.list[i].upkeepInfoCount || 0);
                                    upkeepPercentageB.push(parseFloat(data.data.list[i].upkeepPercentage || 0).toFixed(2));
                                    upkeepTimelyCountB.push(data.data.list[i].upkeepTimelyCount || 0);
                                    upkeepUntimelyCountB.push(data.data.list[i].upkeepUntimelyCount || 0);
                                    upkeepTimelyPercentageB.push(parseFloat(data.data.list[i].upkeepTimelyPercentage || 0).toFixed(2));

                                    inspectionDateCountB.push(data.data.list[i].inspectionDateCount || 0);
                                    inspectionInfoCountB.push(data.data.list[i].inspectionInfoCount || 0);
                                    inspectionPercentageB.push(parseFloat(data.data.list[i].inspectionPercentage || 0).toFixed(2));
                                    inspectionTimelyCountB.push(data.data.list[i].inspectionTimelyCount || 0);
                                    inspectionUntimelyCountB.push(data.data.list[i].inspectionUntimelyCount || 0);
                                    inspectionTimelyPercentageB.push(parseFloat(data.data.list[i].inspectionTimelyPercentage || 0).toFixed(2));

                                    compulsoryDateCountB.push(data.data.list[i].compulsoryDateCount || 0);
                                    compulsoryVerificationCountB.push(data.data.list[i].compulsoryVerificationCount || 0);
                                    compulsoryPercentageB.push(parseFloat(data.data.list[i].compulsoryPercentage || 0).toFixed(2));
                                    compulsoryTimelyCountB.push(data.data.list[i].compulsoryTimelyCount || 0);
                                    compulsoryUntimelyCountB.push(data.data.list[i].compulsoryUntimelyCount || 0);
                                    compulsoryTimelyPercentageB.push(parseFloat(data.data.list[i].compulsoryTimelyPercentage || 0).toFixed(2));

                                    if (title === 0) {
                                        $("#ul_year").append(
                                            '<li><a><span class="fl data_span_f">' + data.data.list[i].monthName + '</span><em class="fl data_span_s">'
                                            + (data.data.list[i].upkeepInfoCount || 0) + '/' + (data.data.list[i].upkeepDateCount || 0) + '</em><em class="fr jqmeter" jqmeter="'
                                            + parseFloat(data.data.list[i].upkeepPercentage || 0).toFixed(2) + '"></em></a></li>');
                                    } else if (title === 1) {
                                        $("#ul_year").append(
                                            '<li><a><span class="fl data_span_f">' + data.data.list[i].monthName + '</span><em class="fl data_span_s">'
                                            + (data.data.list[i].inspectionInfoCount || 0) + '/' + (data.data.list[i].inspectionDateCount || 0) + '</em><em class="fr jqmeter" jqmeter="'
                                            + parseFloat(data.data.list[i].inspectionPercentage || 0).toFixed(2) + '"></em></a></li>');
                                    } else if (title === 2) {
                                        $("#ul_year").append(
                                            '<li><a><span class="fl data_span_f">' + data.data.list[i].monthName + '</span><em class="fl data_span_s">'
                                            + (data.data.list[i].compulsoryVerificationCount || 0) + '/' + (data.data.list[i].compulsoryDateCount || 0) + '</em><em class="fr jqmeter" jqmeter="'
                                            + parseFloat(data.data.list[i].compulsoryPercentage || 0).toFixed(2) + '"></em></a></li>');
                                    }
                                }
                                $('#ul_year .jqmeter').each(function () {
                                    $(this).jQMeter({
                                        goal: '$1,00',
                                        raised: '$' + Math.round($(this).attr('jqmeter')),
                                        width: listcontentWidth - 20 + 'px',
                                        height: '0.24rem'
                                    });
                                });

                                if (title === 0) {
                                    optionB.legend.data = ['<fmt:message key="maintenance.overview.jhbys"/>', '<fmt:message key="maintenance.overview.sjbys"/>', '<fmt:message key="maintenance.overview.byl"/>', '<fmt:message key="maintenance.overview.byjsl"/>'];
                                    optionB.series[0].name = '<fmt:message key="maintenance.overview.jhbys"/>';
                                    optionB.series[1].name = '<fmt:message key="maintenance.overview.sjbys"/>';
                                    optionB.series[2].name = '<fmt:message key="maintenance.overview.byl"/>';
                                    optionB.series[3].name = '<fmt:message key="maintenance.overview.byjsl"/>';
                                    optionB.series[0].data = upkeepDateCountB;
                                    optionB.series[1].data = upkeepInfoCountB;
                                    optionB.series[2].data = upkeepPercentageB;
                                    optionB.series[3].data = upkeepTimelyPercentageB;
                                } else if (title === 1) {
                                    optionB.legend.data = ['<fmt:message key="maintenance.overview.jhxjs"/>', '<fmt:message key="maintenance.overview.sjxjs"/>', '<fmt:message key="maintenance.overview.xjl"/>', '<fmt:message key="maintenance.overview.xjjsl"/>'];
                                    optionB.series[0].name = '<fmt:message key="maintenance.overview.jhxjs"/>';
                                    optionB.series[1].name = '<fmt:message key="maintenance.overview.sjxjs"/>';
                                    optionB.series[2].name = '<fmt:message key="maintenance.overview.xjl"/>';
                                    optionB.series[3].name = '<fmt:message key="maintenance.overview.xjjsl"/>';
                                    optionB.series[0].data = inspectionDateCountB;
                                    optionB.series[1].data = inspectionInfoCountB;
                                    optionB.series[2].data = inspectionPercentageB;
                                    optionB.series[3].data = inspectionTimelyPercentageB;
                                } else if (title === 2) {
                                    optionB.legend.data = ['<fmt:message key="maintenance.overview.jhqjs"/>', '<fmt:message key="maintenance.overview.sjqjs"/>', '<fmt:message key="maintenance.overview.qjl"/>', '<fmt:message key="maintenance.overview.qjjsl"/>'];
                                    optionB.series[0].name = '<fmt:message key="maintenance.overview.jhqjs"/>';
                                    optionB.series[1].name = '<fmt:message key="maintenance.overview.sjqjs"/>';
                                    optionB.series[2].name = '<fmt:message key="maintenance.overview.qjl"/>';
                                    optionB.series[3].name = '<fmt:message key="maintenance.overview.qjjsl"/>';
                                    optionB.series[0].data = compulsoryDateCountB;
                                    optionB.series[1].data = compulsoryVerificationCountB;
                                    optionB.series[2].data = compulsoryPercentageB;
                                    optionB.series[3].data = compulsoryTimelyPercentageB;
                                }
                                optionB.xAxis.data = xAxisB;
                                chart.clear();
                                chart.setOption(optionB);
                            } else {
                                flavrShowByTime(data.msg, null, "danger", false);
                            }
                            loading(true);
                        },
                        failure: function (data) {
                            flavrShowByTime(data.msg, null, "danger", false);
                        }
                    });
                });
            }
        });

        function moreyear() {
            loading(function () {
                var sb = new StringBuffer();
                $("#tblSort").html('<tbody id="table_data"></tbody>');
                sb.append("<thead><tr><th class='text-center'>#</th>");
                //表头
                sb.append("<th class='text-left'><fmt:message key="share.table.head.yf"/></th>");

                if (title === 0) {
                    //表格内容
                    sb.append("<th class='text-right'><fmt:message key="maintenance.overview.jhbys"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.overview.sjbys"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.byjsl(%)"/></th>"
                        + "</tr></thead>");
                    $("#tblSort").prepend(sb.toString());
                    for (var i = 0; i < xAxisB.length; i++) {
                        $("#table_data").append("<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal text-left spanTitle' onclick=\"query('year','" + yearJson[i].month + "')\">" + yearJson[i].monthName + "</td>"
                            + "<td class='total-1 text-right" + (yearJson[i].upkeepDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{monthId:" + yearJson[i].month + ",maintenanceType:1}'," + yearJson[i].upkeepDateCount + ")\">" + (yearJson[i].upkeepDateCount || 0) + "</td>"
                            + "<td class='total-2 text-right" + (yearJson[i].upkeepInfoCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{monthId:" + yearJson[i].month + ",maintenanceType:1}'," + yearJson[i].upkeepInfoCount + ")\">" + (yearJson[i].upkeepInfoCount || 0) + "</td>"
                            + "<td class='total-5 text-right" + (yearJson[i].upkeepDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{monthId:" + yearJson[i].month + ",maintenanceType:1}'," + yearJson[i].upkeepDateAssetsCount + ")\">" + (yearJson[i].upkeepDateAssetsCount || 0) + "</td>"
                            + "<td class='total-6 text-right" + (yearJson[i].upkeepInfoAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{monthId:" + yearJson[i].month + ",maintenanceType:1}'," + yearJson[i].upkeepInfoAssetsCount + ")\">" + (yearJson[i].upkeepInfoAssetsCount || 0) + "</td>"
                            + "<td class='average-3 text-right'>" + parseFloat(yearJson[i].upkeepPercentage || 0).toFixed(2) + "</td>"
                            + "<td class='average-6 text-right'>" + parseFloat(yearJson[i].upkeepTimelyPercentage || 0).toFixed(2) + "</td>"
                            + "</tr>");
                    }
                } else if (title === 1) {
                    //表格内容
                    sb.append("<th class='text-right'><fmt:message key="maintenance.table.jhxjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.sjxjs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.xjjsl(%)"/></th>"
                        + "</tr></thead>");
                    $("#tblSort").prepend(sb.toString());
                    for (var i = 0; i < xAxisB.length; i++) {
                        $("#table_data").append("<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal text-left spanTitle' onclick=\"query('year','" + yearJson[i].month + "')\">" + yearJson[i].monthName + "</td>"
                            + "<td class='total-1 text-right" + (yearJson[i].inspectionDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{monthId:" + yearJson[i].month + ",maintenanceType:2}'," + yearJson[i].inspectionDateAssetsCount + ")\">" + (yearJson[i].inspectionDateCount || 0) + "</td>"
                            + "<td class='total-2 text-right" + (yearJson[i].inspectionInfoCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{monthId:" + yearJson[i].month + ",maintenanceType:2}'," + yearJson[i].inspectionInfoCount + ")\">" + (yearJson[i].inspectionInfoCount || 0) + "</td>"
                            + "<td class='total-5 text-right" + (yearJson[i].inspectionDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{monthId:" + yearJson[i].month + ",maintenanceType:2}'," + yearJson[i].inspectionDateAssetsCount + ")\">" + (yearJson[i].inspectionDateAssetsCount || 0) + "</td>"
                            + "<td class='total-6 text-right" + (yearJson[i].inspectionInfoAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{monthId:" + yearJson[i].month + ",maintenanceType:2}'," + yearJson[i].inspectionInfoAssetsCount + ")\">" + (yearJson[i].inspectionInfoAssetsCount || 0) + "</td>"
                            + "<td class='average-3 text-right'>" + parseFloat(yearJson[i].inspectionPercentage || 0).toFixed(2) + "</td>"
                            + "<td class='average-6 text-right'>" + parseFloat(yearJson[i].inspectionTimelyPercentage || 0).toFixed(2) + "</td>"
                            + "</tr>");
                    }
                } else if (title === 2) {
                    //表格内容
                    sb.append("<th class='text-right'><fmt:message key="maintenance.table.jhqjs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.sjqjs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.jhsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="share.talbe.sjsbs"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjl(%)"/></th>"
                        + "<th class='text-right'><fmt:message key="maintenance.table.qjjsl(%)"/></th>"
                        + "</tr></thead>");
                    $("#tblSort").prepend(sb.toString());
                    for (var i = 0; i < xAxisB.length; i++) {
                        $("#table_data").append("<tr>"
                            + "<td class='no-cal text-center'>" + (i + 1) + "</td>"
                            + "<td class='no-cal text-left spanTitle' onclick=\"query('year','" + yearJson[i].month + "')\">" + yearJson[i].monthName + "</td>"
                            + "<td class='total-1 text-right" + (yearJson[i].compulsoryDateCount ? ' spanTitle' : '') + "' onclick=\"query('plan-record','{monthId:" + yearJson[i].month + ",maintenanceType:3}'," + yearJson[i].compulsoryDateCount + ")\">" + (yearJson[i].compulsoryDateCount || 0) + "</td>"
                            + "<td class='total-2 text-right" + (yearJson[i].compulsoryVerificationCount ? ' spanTitle' : '') + "' onclick=\"query('actual-record','{monthId:" + yearJson[i].month + ",maintenanceType:3}'," + yearJson[i].compulsoryVerificationCount + ")\">" + (yearJson[i].compulsoryVerificationCount || 0) + "</td>"
                            + "<td class='total-5 text-right" + (yearJson[i].compulsoryDateAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('plan-device','{monthId:" + yearJson[i].month + ",maintenanceType:3}'," + yearJson[i].compulsoryDateAssetsCount + ")\">" + (yearJson[i].compulsoryDateAssetsCount || 0) + "</td>"
                            + "<td class='total-6 text-right" + (yearJson[i].compulsoryVerificationAssetsCount ? ' spanTitle' : '') + "' onclick=\"query('actual-device','{monthId:" + yearJson[i].month + ",maintenanceType:3}'," + yearJson[i].compulsoryVerificationAssetsCount + ")\">" + (yearJson[i].compulsoryVerificationAssetsCount || 0) + "</td>"
                            + "<td class='average-3 text-right'>" + parseFloat(yearJson[i].compulsoryPercentage || 0).toFixed(2) + "</td>"
                            + "<td class='average-6 text-right'>" + parseFloat(yearJson[i].compulsoryTimelyPercentage || 0).toFixed(2) + "</td>"
                            + "</tr>");
                    }
                }

                calTableData("tblSort", true);
                $('#modal').iziModal('setTitle', '<fmt:message key="share.table.title.yffb"/>');
                $('#modal').iziModal('open', this);
                loading(true);
            });
        }

        // 柱状 + 折线
        var optionB = {
            color: ['#2089ff', '#6c63ff', '#12a0df', '#fb8a22', '#fef534'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                },
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var index = a[0].dataIndex;
                        if (title == 0) {
                            return xAxisB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.jhbys"/>：' + upkeepDateCountB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.sjbys"/>：' + upkeepInfoCountB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.byl"/>：' + upkeepPercentageB[index] + '%<br/>'
                                + '<fmt:message key="maintenance.overview.byjsl"/>：' + upkeepTimelyPercentageB[index] + '%';
                        } else if (title == 1) {
                            return xAxisB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.jhxjs"/>：' + inspectionDateCountB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.sjxjs"/>：' + inspectionInfoCountB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.xjl"/>：' + inspectionPercentageB[index] + '%<br/>'
                                + '<fmt:message key="maintenance.overview.xjjsl"/>：' + inspectionTimelyPercentageB[index] + '%';
                        } else if (title == 2) {
                            return xAxisB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.jhqjs"/>：' + compulsoryDateCountB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.sjqjs"/>：' + compulsoryVerificationCountB[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.qjl"/>：' + compulsoryPercentageB[index] + '%<br/>'
                                + '<fmt:message key="maintenance.overview.qjjsl"/>：' + compulsoryTimelyPercentageB[index] + '%';
                        }
                    }
                }
            },
            legend: {
                x: "right",
                textStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                data: ['<fmt:message key="maintenance.overview.jhbys"/>', '<fmt:message key="maintenance.overview.sjbys"/>', '<fmt:message key="maintenance.overview.byl"/>', '<fmt:message key="maintenance.overview.byjsl"/>']
            },
            dataZoom: [{
                type: 'inside',
                xAxisIndex: [0],
                start: 0,
                end: 100
            }],
            grid: {
                top: 1.2 * rem,
                left: 0.4 * rem,
                right: 0.4 * rem,
                bottom: 0.8 * rem,
                containLabel: true
            },
            xAxis: {
                type: 'category',
                data: [],
                axisLabel: {
                    rotate: 30,
                    fontSize: 0.28 * rem
                }
            },
            yAxis: [{
                name: '<fmt:message key="charts.formatter.sl"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    lineStyle: {
                        type: 'dashed'
                    }
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }, {
                name: '%',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    show: false
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }],
            series: [{
                name: '<fmt:message key="maintenance.overview.jhbys"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: []
            }, {
                name: '<fmt:message key="maintenance.overview.sjbys"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                data: []
            }, {
                name: '<fmt:message key="maintenance.overview.byl"/>',
                type: 'line',
                yAxisIndex: 1,
                data: []
            }, {
                name: '<fmt:message key="maintenance.overview.byjsl"/>',
                type: 'line',
                yAxisIndex: 1,
                data: []
            }]
        };

        // 柱状 + 折线
        var optionB1 = {
            color: ['#2089ff', '#6c63ff', '#12a0df', '#fb8a22', '#fef534'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: { // 坐标轴指示器，坐标轴触发有效
                    type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
                },
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var index = a[0].dataIndex;
                        if (title == 0) {
                            return xAxisTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.jhbys"/>：' + jnUpkeepDateCountTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.sjbys"/>：' + jnUpkeepInfoCountTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.byl"/>：' + jnUpkeepPercentageTypeOption[index] + '%<br/>'
                                + '<fmt:message key="maintenance.charts.byltb"/>：' + tbUpkeepPercentageTypeOption[index] + '%<br/>'
                                + '<fmt:message key="maintenance.overview.byjsl"/>：' + upkeepTimelyPercentageTypeOption[index] + '%';
                        } else if (title == 1) {
                            return xAxisTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.jhxjs"/>：' + jnInspectionDateCountTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.sjxjs"/>：' + jnInspectionInfoCountTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.xjl"/>：' + jnInspectionPercentageTypeOption[index] + '%<br/>'
                                + '<fmt:message key="maintenance.charts.xjltb"/>：' + tbInspectionPercentageTypeOption[index] + '%<br/>'
                                + '<fmt:message key="maintenance.overview.xjjsl"/>：' + inspectionTimelyPercentageTypeOption[index] + '%';
                        } else if (title == 2) {
                            return xAxisTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.jhqjs"/>：' + jnCompulsoryDateCountTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.sjqjs"/>：' + jnCompulsoryVerificationCountTypeOption[index] + '<br/>'
                                + '<fmt:message key="maintenance.overview.qjl"/>：' + jnCompulsoryPercentageTypeOption[index] + '%<br/>'
                                + '<fmt:message key="maintenance.charts.qjltb"/>：' + tbCompulsoryPercentageTypeOption[index] + '%<br/>'
                                + '<fmt:message key="maintenance.overview.qjjsl"/>：' + compulsoryTimelyPercentageTypeOption[index] + '%';
                        }
                    }
                }
            },
            legend: {
                x: "right",
                textStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                data: ['<fmt:message key="maintenance.overview.jhbys"/>', '<fmt:message key="maintenance.overview.sjbys"/>', '<fmt:message key="maintenance.overview.byl"/>', '<fmt:message key="maintenance.overview.byjsl"/>']
            },
            dataZoom: [{
                type: 'inside',
                xAxisIndex: [0],
                start: 0,
                end: 100
            }],
            grid: {
                top: 1.2 * rem,
                left: 0.4 * rem,
                right: 0.4 * rem,
                bottom: 0.8 * rem,
                containLabel: true
            },
            xAxis: {
                type: 'category',
                data: [],
                axisLabel: {
                    rotate: 30,
                    fontSize: 0.28 * rem
                }
            },
            yAxis: [{
                name: '<fmt:message key="charts.formatter.sl"/>',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    lineStyle: {
                        type: 'dashed'
                    }
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }, {
                name: '%',
                type: 'value',
                nameTextStyle: {
                    color: '#AAA',
                    fontSize: 0.28 * rem
                },
                splitLine: {
                    show: false
                },
                axisLabel: {
                    fontSize: 0.28 * rem
                }
            }],
            series: [{
                name: '<fmt:message key="maintenance.overview.jhbys"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                barGap: '0%',
                data: [],
                itemStyle: {
                    normal: {
                        opacity: 0.8
                    }
                }
            }, {
                name: '<fmt:message key="maintenance.overview.sjbys"/>',
                type: 'bar',
                barMaxWidth: barMaxWidth,
                data: [],
                itemStyle: {
                    normal: {
                        opacity: 0.8
                    }
                }
            }, {
                name: '<fmt:message key="maintenance.overview.byl"/>',
                type: 'line',
                yAxisIndex: 1,
                data: [],
                lineStyle: {
                    normal: {
                        width: 2
                    }
                }
            }, {
                name: '<fmt:message key="maintenance.overview.byjsl"/>',
                type: 'line',
                yAxisIndex: 1,
                data: [],
                lineStyle: {
                    normal: {
                        width: 2
                    }
                }
            }]
        };
    </script>
    </body>
</fmt:bundle>
</html>
